<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserLab extends Model
{
    /**
     * Don't auto-apply mass assignment protection.
     *
     * @var array
     */
    protected $guarded = [];

    protected $table = 'users_labs';

    // also fillable
    protected $fillable = [
        'lab_id',
//        'forum_channels_id',
        'user_id',
        'admin'
    ];
    //
    public function members()
    {
        return $this->belongsToMany('App\Models\Auth\User', 'users_labs', 'lab_id', 'user_id')->withPivot('admin');
    }
}
