dimanche 18 octobre 2015

crud in laravel 5.1.11 controller

Insert Controller === Insert data to Database

public function create() 
{
  return view('books.create');
}
public function store()
{
  $book=Request::all();
  Book::create($book);
  return redirect('books');
}

** My Url

http://localhost/laravel/bookstore/public/books

** Problem show in my browser

Whoops, looks like something went wrong.

1/1 ErrorException in BookController.php line 40:

Non-static method Illuminate\Http\Request::all() should not be called statically, assuming $this from incompatible context



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire