예제 #1
0
<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in 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.
|
*/
use Illuminate\Support\Facades\Route;
Route::pattern('id', '[1-9][0-9]*');
Route::pattern('slug', '[a-z_-]*');
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['throttle:60,1']], function () {
    Route::post('/prod/scroll', 'FrontController@scrollProd');
});
Route::group(['middleware' => ['web']], function () {
    Route::get('/', ['as' => 'home', 'uses' => 'FrontController@index']);
    Route::get('/prod/{id}/{slug?}', 'FrontController@showProduct');
 /**
  * All patterns url
  */
 protected function registerPatterns()
 {
     Route::pattern('id', '[0-9]+');
     Route::pattern('scope', '[A-za-z0-9-]+');
     Route::pattern('model', '[A-za-z0-9-]+');
 }