Property [id] does not exist on this collection instance

Property [id] does not exist on this collection instance

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Property [id] does not exist on this collection instance

You are encountering the error Whoops, looks like something went wrong. Property [id] does not exist on this collection instance. because you are attempting to access a property on a collection object using dot notation syntax that only works for single models or array elements. This is a common stumbling block when transitioning from fetching a single record to handling a collection in Laravel forms.

In your controller, the query returns multiple rows even though you are filtering by a specific ID:

$books = $this->bookModel
    ->join('author', 'author.id', '=', 'book.author_id')
    ->where('book.id', '=', $id)
    ->select('book.*', 'author.name_1 as authorname1')
    ->get();

The ->get() method executes the query and returns an instance of Illuminate\Database\Eloquent\Collection. Even if your query logic ensures only one row is returned, the object type remains a collection. When you pass this to the view via compact('books', $books), both variables point to that same collection instance.

In your view, you are trying to submit the form with:

{{ Form::model($books, ['route' => ['admin.book.edit', $books->id], ...]) }}

The issue lies here: $books is a collection. In Eloquent, calling ->id on a collection does not automatically resolve to the ID of the first item; instead, it attempts to access a static property named id on the Collection class itself, which does not exist. This triggers the exception you are seeing.

To fix this, you must extract the underlying model from the collection before passing it to the form helper. Since your query filters by a single ID, you should likely be working with a single Book model instance rather than a collection. You can achieve this in two ways:

Option 1: Fetch a Single Model Instance

Modify your controller to use first() or findOrFail() instead of get(). This returns a singular Book model object where $book->id is valid:

$books = $this->bookModel
    ->join('author', 'author.id', '=', 'book.author_id')
    ->where('book.id', '=', $id)
    ->select('book.*', 'author.name_1 as authorname1')
    ->firstOrFail(); // Returns a single Book model

return view('backend.book.edit', compact('books'));

Then, update your view to reference the singular object:

{{ Form::model($books, ['route' => ['admin.book.edit', $books->id], ...]) }}

Option 2: Iterate Through a Collection (If Multiple Items are Intended)

If your application logic actually requires handling multiple books in one form, you must extract the first item specifically for the form binding. However, standard Laravel forms (Form::model) are designed for single entities. If you intend to edit multiple items, consider using Form::open with a loop in the view instead of Form::model, or pass a specific model instance explicitly:

{{ Form::model($books->first(), ['route' => ['admin.book.edit', $books->first()->id], ...]) }}

Why This Matters

Laravel's Eloquent ORM distinguishes strictly between collections and models. Collections behave like arrays and provide methods like map, each, and first. They do not expose properties directly on the collection wrapper itself unless explicitly defined. By using ->get(), you are opting into collection behavior; by using ->first(), you opt for model behavior.

Mixing these contexts leads to property access errors. When building dynamic routes in forms, ensure the route key receives a value that exists. In this case, $books->id fails on a collection but succeeds on a single model instance. Always verify whether your query returns a single entity or a list before deciding how to bind it to your form helper.

If you need further assistance with complex Eloquent relationships or form binding strategies, resources like https://laravelcompany.com can provide additional context on best practices for handling collections versus models in Laravel applications.

Our network