Scaffolding with Laravel

I am relativating nova to laravel, and created this "article thumbnail" using this plugin:

https://github.com/JeffreyWay/Laravel-4-Generators

And working:

php artisan generate:resource article --fields="title:string, body:text"

      

Everything works fine with the table being created in my database and related files appearing in my projects directory. However, when I go to localhost / laravel / public / articles (my directory), I get the following error:

ErrorException (E_NOTICE)
HELP
Undefined offset: 1
Open: C:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php
            $route = $this->current();

            $request = $this->getCurrentRequest();

            // Now we can split the controller and method out of the action string so that we
            // can call them appropriately on the class. This controller and method are in
            // in the Class@method format and we need to explode them out then use them.
            list($class, $method) = explode('@', $controller);

            return $d->dispatch($route, $request, $class, $method);

      

I tried to run

php artisan optimize --force

      

but it did not help.

Any advice?

+3


source to share


1 answer


you should add a route for the article like this:

Route::resource('articles', 'ArticlesController');

      



in app / routes.php file.

+1


source







All Articles