Laravel throws because a column was read from a query that never ran
Your error
Exception: Property [title] does not exist on the Eloquent builder instance.1 more line it can showFix it fast
Most common cause, 1 of 3The query chain stops before a method that fetches a row
Finish the chain with a method that runs the query and returns one model, or with value() when only one column is needed.
$post = Post::where('slug', $slug)->firstOrFail();
$title = $post->title;
// just the column, null when no row matches
$title = Post::where('slug', $slug)->value('title');Short answer
Exception "Property [title] does not exist on the Eloquent builder instance" means a column was read from an Eloquent query that was never executed. where(), with(), orderBy() and local scopes return a Builder, not a model. End the chain with first(), firstOrFail() or find(), or call value('title') for a single column. Applies to Laravel 12 and 13.
Which cause do you have?
Dump the class of the variable whose property fails, right where it is read. Illuminate\Database\Eloquent\Builder means the query was built but never run; a model class name means the problem is elsewhere.
dd(get_class($post));Then find the line you see in this list and open its fix:
- 1The query chain stops before a method that fetches a row
The failing line reads a property straight off Post::where(...), Post::with(...), Post::latest() or a local scope such as Post::published() - 2The controller hands an unfinished query to the Blade view
The stack trace ends in a compiled view under storage/framework/views, and the controller assigns $post = Post::where(...) without a fetch method - 3An API resource wraps a query instead of a model
The trace runs through a class in app/Http/Resources, for example PostResource::toArray(), and the route does new PostResource(Post::where(...))
What does the error look like?
Exception: Property [title] does not exist on the Eloquent builder instance.Property [name] does not exist on the Eloquent builder instance.
Cause 1 of 3
The query chain stops before a method that fetches a row
You seeThe failing line reads a property straight off Post::where(...), Post::with(...), Post::latest() or a local scope such as Post::published()
Check
Laravel throws Property [title] does not exist on the Eloquent builder instance when a column is read from an object that is still a query. Each where(), with(), orderBy() or scope call hands back the Eloquent Builder, and the Builder answers any unknown property with this exception; no SQL has run yet, so there is no row to read from.
$title = Post::where('slug', $slug)->title; // still a BuilderFix
Finish the chain with a method that runs the query and returns one model, or with value() when only one column is needed.
$post = Post::where('slug', $slug)->firstOrFail();
$title = $post->title;
// just the column, null when no row matches
$title = Post::where('slug', $slug)->value('title');Verify
The variable now holds an App\Models\Post instance, or the column value.
dd(get_class($post), $post->title);Confirmed by laravel.com
Cause 2 of 3
The controller hands an unfinished query to the Blade view
You seeThe stack trace ends in a compiled view under storage/framework/views, and the controller assigns $post = Post::where(...) without a fetch method
Check
When the exception points into a view, the controller passed the Builder itself. Blade then evaluates {{ $post->title }} against the query object, and the same exception surfaces while the template renders, far from the line that caused it.
// controller
$post = Post::where('slug', $slug);
return view('posts.show', compact('post'));Fix
Run the query in the controller. firstOrFail() also turns a missing row into a 404 response instead of an error page.
$post = Post::where('slug', $slug)->firstOrFail();
return view('posts.show', compact('post'));Verify
The page renders the title, and an unknown slug returns 404.
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/posts/no-such-slugConfirmed by laravel.com
Cause 3 of 3
An API resource wraps a query instead of a model
You seeThe trace runs through a class in app/Http/Resources, for example PostResource::toArray(), and the route does new PostResource(Post::where(...))
Check
A JSON resource forwards every $this->title it reads to the object it wraps. Wrap an unexecuted query and that forwarding lands on the Builder, which throws the same Property does not exist message from inside toArray().
return new PostResource(Post::where('slug', $slug));Fix
Give the resource a model for a single item, or a fetched collection for a list.
return new PostResource(Post::where('slug', $slug)->firstOrFail());
return PostResource::collection(Post::where('published', true)->get());Verify
The endpoint returns JSON with the post's fields.
curl -s https://example.com/api/posts/hello-worldConfirmed by laravel.com
How do I stop it coming back?
- Declare return types on repository and service methods (: Post, : Collection); PHP then throws a TypeError where a Builder is returned by mistake, instead of an exception deep in a view.
- Name query objects and results differently ($postQuery, $post), so a variable that still needs ->firstOrFail() is obvious in review.
- Give every show route and API resource a feature test that expects 200 for an existing record and 404 for a missing one.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: Spotless Laundry, EZ Estimater.