2025-06-15 16:29:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Blax\Roles\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class RoleMember extends Model {
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'role_id',
|
|
|
|
|
'member',
|
|
|
|
|
'context',
|
|
|
|
|
'expires_at',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function __construct(array $attributes = [])
|
|
|
|
|
{
|
|
|
|
|
parent::__construct($attributes);
|
|
|
|
|
|
2025-06-16 05:37:35 +00:00
|
|
|
$this->table = config('roles.table_names.role_members') ?: parent::getTable();
|
2025-06-15 16:29:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function role() {
|
|
|
|
|
return $this->belongsTo(Role::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function member() {
|
|
|
|
|
return $this->morphTo();
|
|
|
|
|
}
|
|
|
|
|
}
|