web.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. use App\Billing\Stripe;
  22. use App\Providers\AppServiceProvider;
  23. // Can use either the class name or a readable service name, thanks to aliasing.
  24. $stripe = App::make(AppServiceProvider::STRIPE);
  25. $stripeAgain = app(AppServiceProvider::STRIPE);
  26. $stripeAlso = resolve(Stripe::class);
  27. $stripeToo = app()->make(Stripe::class);
  28. dd($stripe, $stripeAgain, $stripeAlso, $stripeToo);
  29. /** @var \Illuminate\Routing\Router $this */
  30. $this->get('/', 'PostsController@index')
  31. ->name('home');
  32. $this->post('/posts', 'PostsController@store');
  33. $this->get('/posts/create', 'PostsController@create');
  34. $this->get('/posts/{post}', 'PostsController@show');
  35. $this->post('/posts/{post}/comments', 'CommentsController@store');
  36. $this->get('register', 'RegistrationController@create');
  37. $this->post('register', 'RegistrationController@store');
  38. $this->get('login', 'SessionsController@create');
  39. $this->post('login', 'SessionsController@store');
  40. $this->get('logout', 'SessionsController@destroy');