30 lines
451 B
PHP
30 lines
451 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class RoleUser extends Model
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* The table associated with the model.
|
||
|
|
*
|
||
|
|
* @var string
|
||
|
|
*/
|
||
|
|
protected $table = 'role_user';
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'user_id', 'role_id',
|
||
|
|
];
|
||
|
|
|
||
|
|
|
||
|
|
public function user()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class);
|
||
|
|
}
|
||
|
|
public function role()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Role::class);
|
||
|
|
}
|
||
|
|
}
|