*/ protected $fillable = [ 'name', 'email', 'password', 'user_type', 'user_phone', 'user_nif' ]; /** * 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', ]; // public function typeUser(){ // return $this->belongsTo(TypeUser::class, 'type_users', 'type_user_id'); // } public function userType() { return $this->belongsTo(TypeUser::class, 'type_users', 'type_user_id'); } public function plants(){ return $this->hasMany(Plant::class,'user_id', 'user_id'); } }