web.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 singleton() instead to obtain a reused instance.
  23. // Use instance(Stripe::class, $stripe) to replace the instance with another object.
  24. App::bind(Stripe::class, function () {
  25. return new Stripe(config('services.stripe.key'));
  26. });
  27. $stripe = App::make(Stripe::class);
  28. $stripeAgain = app(Stripe::class);
  29. $stripeAlso = resolve(Stripe::class);
  30. $stripeToo = app()->make(Stripe::class);
  31. dd($stripe, $stripeAgain, $stripeAlso, $stripeToo);
  32. /** @var \Illuminate\Routing\Router $this */
  33. $this->get('/', 'PostsController@index')
  34. ->name('home');
  35. $this->post('/posts', 'PostsController@store');
  36. $this->get('/posts/create', 'PostsController@create');
  37. $this->get('/posts/{post}', 'PostsController@show');
  38. $this->post('/posts/{post}/comments', 'CommentsController@store');
  39. $this->get('register', 'RegistrationController@create');
  40. $this->post('register', 'RegistrationController@store');
  41. $this->get('login', 'SessionsController@create');
  42. $this->post('login', 'SessionsController@store');
  43. $this->get('logout', 'SessionsController@destroy');