belongsTo(Building::class,'building_id','id')->withTrashed() ; } public function reservations() { return $this->hasMany(Loan::class,'room_id') ->where('loan_type_id','!=',LoanType::where('name','=','Loan')->first()->id) ; } }