Level 18
It doesn't create the routes.
You need to add Route::resource('posts', 'PostController'); in your route file.
https://laravel.com/docs/5.8/controllers#resource-controllers
Hi and I created the controller like this.
php artisan make:controller PostController -r
It looks good but when I
php artisan route:list
I only see
+--------+----------+----------+------+---------+--------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+----------+------+---------+--------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/user | | Closure | api,auth:api |
+--------+----------+----------+------+---------+--------------+
I though it creates all the routes as well. No?
How can I generate routes for a currently created controller?
Thanks
It doesn't create the routes.
You need to add Route::resource('posts', 'PostController'); in your route file.
https://laravel.com/docs/5.8/controllers#resource-controllers
Please or to participate in this conversation.