blue-twilight/app/Group.php

22 lines
338 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Group extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name'
];
public function users()
{
return $this->belongsToMany(User::class, 'user_groups');
}
}