Skip to main content

Command Palette

Search for a command to run...

Exception Property [Id_pet] does not exist on the Eloquent builder instance

Laravel 9

Published
1 min read
Exception
Property [Id_pet] does not exist on the Eloquent builder instance
L

I've got accomplished web development with expertise in various programming languages including PHP, Laravel, C#, and C++. My curiosity to learn more and my passion for coding drives me to constantly enhance my skills and create exceptional digital experiences.

This error has occurred because the controller was unable to find the primary key of the table with the command

$petstore = Petstore::find($Parameter)

So instead of find() I'll use where();

$petstore = Petstore::where('$primarykey','$parameter')->first();