*/ protected $fillable = [ 'username', 'name', 'password', 'position', 'status', 'avatar' ]; /** * The attributes that should be hidden for serialization. * @var array */ protected $hidden = [ 'password', 'remember_token', 'locale', 'deleted_at', 'updated_at' ]; /** * The attributes that should be cast. * @var array */ protected $casts = []; /** * @return BelongsToMany */ public function roles(): BelongsToMany { return $this->belongsToMany(AdminRoles::class, AdminRoleUsers::class, 'user_id', 'role_id'); } }