Скеле с Laravel

Аз съм сравнително нов в laravel и създадох скеле „статия“, използвайки този плъгин:

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

И тичане:

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

Всичко работи добре, като таблицата се създава в моята база данни и свързаните файлове се появяват в директорията на моя проект. Въпреки това, когато навигирам до localhost/laravel/public/articles (моята директория), получавам следната грешка:

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);

Опитах да тичам

php artisan optimize --force

но това не помогна.

Някакъв съвет?


person MrD    schedule 30.05.2015    source източник
comment
Защо ще навигирате там?   -  person Ali Gajani    schedule 30.05.2015
comment
За да получите списък с всички мои статии   -  person MrD    schedule 31.05.2015
comment
Каква версия на Laravel използвате? Ако е 5.*, тогава трябва да използвате този пакет: github.com/laracasts/Laravel -5-Разширени генератори   -  person Anatoliy Arkhipov    schedule 31.05.2015


Отговори (1)


трябва да добавите маршрут за статия като тази:

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

във файла app/routes.php.

person Ehsan Farajzadeh    schedule 31.05.2015