Facebook
From Baby Iguana, 9 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 85
  1. <?php
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Web Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register web routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | contains the "web" middleware group. Now create something great!
  11. |
  12. */
  13.  
  14. // Route::get('/', function () {
  15. //     return view('welcome');
  16. // });
  17.  
  18. Auth::routes();
  19.  
  20. Route::get('/home', 'HomeController@index')->name('home');
  21.  
  22. Route::get('/', 'PageController@welcome');
  23.  
  24.  
  25. Route::get('/cart', 'PageController@cart');
  26.  
  27. Route::group(["middleware" => "auth"], function () {
  28.         Route::get('/checkout', 'PageController@checkout');
  29.         Route::get("/confirmation", "PageController@confirmation");
  30. });
  31.  
  32. // Route::get('/products', 'ProductController@index')->middleware("auth");
  33. Route::group(["middleware" => ["isAdmin", "auth"]], function()
  34. {
  35.         Route::get("/products", "ProductController@index");
  36.         Route::delete("/products/{id}", "ProductController@destroy");
  37.         Route::get("products/{id}/edit", "ProductController@edit");
  38.         Route::put("/products/{id}", "ProductController@update");
  39.         Route::get("/products/create", "ProductController@create");
  40. });
  41.  
  42. Route::post("addToCart/{id}", "CartController@addToCart");
  43.  
  44.