jeudi 19 janvier 2017

Laravel Undefined variable: books in View

The problem is undefined variable in view. My controller:

use App\Book;
class bookController extends Controller
{
public function index()
{
  $books = Book::all();

  return view('frontend.index')->with('books', $books);
}
}

I get undefined variable books; I was searching here and on the web and tried many things and I still get that error.

Not sure why. Can someone help me?

Thank you



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jC8Dm2
via IFTTT

Aucun commentaire:

Enregistrer un commentaire