*/ protected $fillable = [ 'name', 'email', 'password', 'status', 'role_id', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; public function role(): BelongsTo { return $this->belongsTo(Role::class); } public function pembelajarans() { return $this->belongsToMany(Pembelajaran::class, 'pembelajaran_user'); } public function student(): HasOne { return $this->hasOne(\App\Models\Student::class, 'user_id'); } }