*/ protected $fillable = [ 'name', 'email', 'no_telp', 'password', 'role_id', // Added role_id to the fillable attributes ]; /** * 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', ]; /** * Get the role associated with the user. */ public function role() { return $this->belongsTo(Role::class); // Defines the relationship to the Role model } }