web.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. | Reminder about typical REST routes
  12. | GET /posts List posts
  13. | GET /posts/create Show a post creation form
  14. | POST /posts Create a post
  15. | GET /posts/{id} Show a post
  16. | GET /posts/{id}/edit Show a post update form
  17. | PATCH /posts/{id} Update a post
  18. | DELETE /posts/{id} Delete a post
  19. |--------------------------------------------------------------------------
  20. */
  21. /** @var \Illuminate\Routing\Router $this */
  22. $this->get('/', 'PostsController@index')
  23. ->name('home');
  24. $this->post('/posts', 'PostsController@store');
  25. $this->get('/posts/create', 'PostsController@create');
  26. $this->get('/posts/{post}', 'PostsController@show');
  27. $this->post('/posts/{post}/comments', 'CommentsController@store');
  28. $this->get('/posts/tags/{tag}', 'TagsController@index');
  29. $this->get('register', 'RegistrationController@create');
  30. $this->post('register', 'RegistrationController@store');
  31. $this->get('login', 'SessionsController@create');
  32. $this->post('login', 'SessionsController@store');
  33. $this->get('logout', 'SessionsController@destroy');