Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- |--------------------------------------------------------------------------
- | Application Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register all of the routes for an application.
- | It's a breeze. Simply tell Laravel the URIs it should respond to
- | and give it the controller to call when that URI is requested.
- |
- */
- // INJECCION DE DEPENDENCIAS
- Route::bind('product',function($slug){
- return stock\Product::where('slug',$slug)->first();
- });
- Route::get('/',[
- 'uses' => 'homeController@index',
- 'as' => 'home'
- ]);
- Route::get('product/{slug}',[
- 'uses' => 'homeController@show',
- 'as' => 'product-detail'
- ]);
- Route::get('search',[
- 'uses' => 'homeController@search',
- 'as' => 'search'
- ]);
- Route::get('venta/{slug}',[
- 'uses' => 'homeController@venta',
- 'as' => 'venta'
- ]);
- // Carro de compras
- Route::get('cart/show',[
- 'uses' => 'cartController@show',
- 'as' => 'cart-show'
- ]);
- Route::get('cart/add/{product}',[
- 'uses' => 'cartController@add',
- 'as' => 'cart-add'
- ]);
- Route::get('cart/delete/{product}',[
- 'uses' => 'cartController@delete',
- 'as' => 'cart-delete'
- ]);
- Route::get('cart/trash',[
- 'uses' => 'cartController@trash',
- 'as' => 'cart-trash'
- ]);
- Route::get('cart/update/{products}/{quantity}',[
- 'uses' => 'cartController@update',
- 'as' => 'cart-update'
- ]);
- //Route::get('/',function(){
- // return view('inicio');
- //});
Add Comment
Please, Sign In to add comment