Skip to content
Advertisement

Tag: eloquent

Error in showing laravel data to blade using eloquent

I have this Contractor Model And ContractorDetails Model I can retrieve all columns under the Contractors Model, but whenever I do this $contractors->ContractorDetails->id, it will show this error “Trying to get property ‘id’ of non-object” . however when I just use this $contractors->ContractorDetails, it is able to show this collection {“id”:6,”contractors_id”:24} My controller looks like this My blade file Any

Advertisement