web.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Web Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register web routes for your application. These
  8. | routes are loaded by the RouteServiceProvider within a group which
  9. | contains the "web" middleware group. Now create something great!
  10. |
  11. */
  12. /** @var \Illuminate\Routing\Router $this */
  13. $this->get('/', 'PostsController@index');
  14. $this->post('/posts', 'PostsController@store');
  15. $this->get('/posts/create', 'PostsController@create');
  16. $this->get('/posts/{post}', 'PostsController@show');
  17. $this->post('/posts/{post}/comments', 'CommentsController@store');
  18. /* Reminder about typical REST routes
  19. GET /posts List posts
  20. GET /posts/create Show a post creation form
  21. POST /posts Create a post
  22. GET /posts/{id} Show a post
  23. GET /posts/{id}/edit Show a post update form
  24. PATCH /posts/{id} Update a post
  25. DELETE /posts/{id} Delete a post
  26. */
  27. // Auth::routes();
  28. $this->auth();
  29. Route::get('/home', 'HomeController@index')->name('home');