Laxtour

Untitled

Jan 9th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Application Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register all of the routes for an application.
  9. | It's a breeze. Simply tell Laravel the URIs it should respond to
  10. | and give it the controller to call when that URI is requested.
  11. |
  12. */
  13.  
  14. // INJECCION DE DEPENDENCIAS
  15.  
  16. Route::bind('product',function($slug){
  17. return stock\Product::where('slug',$slug)->first();
  18. });
  19.  
  20. Route::get('/',[
  21. 'uses' => 'homeController@index',
  22. 'as' => 'home'
  23.  
  24. ]);
  25.  
  26. Route::get('product/{slug}',[
  27. 'uses' => 'homeController@show',
  28. 'as' => 'product-detail'
  29. ]);
  30.  
  31. Route::get('search',[
  32. 'uses' => 'homeController@search',
  33. 'as' => 'search'
  34. ]);
  35.  
  36. Route::get('venta/{slug}',[
  37. 'uses' => 'homeController@venta',
  38. 'as' => 'venta'
  39. ]);
  40.  
  41.  
  42. // Carro de compras
  43.  
  44. Route::get('cart/show',[
  45. 'uses' => 'cartController@show',
  46. 'as' => 'cart-show'
  47. ]);
  48.  
  49.  
  50. Route::get('cart/add/{product}',[
  51. 'uses' => 'cartController@add',
  52. 'as' => 'cart-add'
  53. ]);
  54. Route::get('cart/delete/{product}',[
  55. 'uses' => 'cartController@delete',
  56. 'as' => 'cart-delete'
  57. ]);
  58. Route::get('cart/trash',[
  59. 'uses' => 'cartController@trash',
  60. 'as' => 'cart-trash'
  61. ]);
  62.  
  63. Route::get('cart/update/{products}/{quantity}',[
  64. 'uses' => 'cartController@update',
  65. 'as' => 'cart-update'
  66. ]);
  67.  
  68. //Route::get('/',function(){
  69. // return view('inicio');
  70. //});
Add Comment
Please, Sign In to add comment