Monday, April 10, 2017

[SOLVED]Property [id] does not exist on this collection instance

I am trying to create edit page and this error keeps popping up Whoops, looks like something went wrong. Property [id] does not exist on this collection instance. What I've done so far
This is my Route
Route::get('book/edit/{id}', 'BookController@edit')->name('admin.book.edit');
Route::PATCH('book/edit/{id}', 'BookController@update')->name('admin.book.edit');

This is my controller
$books = $this->bookModel
        ->join('author', 'author.id', '=', 'book.author_id')
        ->where('book.id', '=', $id)
        ->select('book.*', 'author.name_1 as authorname1')
        ->get();
    return view('backend.book.edit', compact('books', $books));

Finally view file have the following in form part

<!--form content-->


Any help will be appreciated. Thanks


via Regolith

Advertisement