Route::post('clients/update/{id}', ['as' => 'clients.update', 'uses' => 'ClientsController@update']); Route::get('products', ['as' => 'products.index', 'uses' => 'ProductsController@index']); Route::get('products/create', ['as' => 'products.create', 'uses' => 'ProductsController@create']); Route::post('products/store', ['as' => 'products.store', 'uses' => 'ProductsController@store']); Route::get('products/edit/{id}', ['as' => 'products.edit', 'uses' => 'ProductsController@edit']); Route::get('products/destroy/{id}', ['as' => 'products.destroy', 'uses' => 'ProductsController@destroy']); Route::post('products/update/{id}', ['as' => 'products.update', 'uses' => 'ProductsController@update']); Route::get('orders', ['as' => 'orders.index', 'uses' => 'OrdersController@index']); Route::get('orders/edit/{id}', ['as' => 'orders.edit', 'uses' => 'OrdersController@edit']); Route::post('orders/update/{id}', ['as' => 'orders.update', 'uses' => 'OrdersController@update']); Route::get('cupoms', ['as' => 'cupoms.index', 'uses' => 'CupomsController@index']); Route::get('cupoms/edit/{id}', ['as' => 'cupoms.edit', 'uses' => 'CupomsController@edit']); Route::post('cupoms/update/{id}', ['as' => 'cupoms.update', 'uses' => 'CupomsController@update']); Route::get('cupoms/create', ['as' => 'cupoms.create', 'uses' => 'CupomsController@create']); Route::post('cupoms/store', ['as' => 'cupoms.store', 'uses' => 'CupomsController@store']); }); route::group(['middleware' => 'cors'], function () { route::group(['prefix' => 'api', 'middleware' => 'oauth', 'as' => 'api.'], function () { Route::group(['prefix' => 'client', 'middleware' => 'oauth.checkrole:client', 'as' => 'client.'], function () { Route::resource('order', 'Api\\Client\\ClientCheckoutController', ['except' => ['create', 'edit', 'destroy']]); Route::get('products', 'Api\\Client\\ClientProductController@index'); }); Route::group(['prefix' => 'deliveryman', 'middleware' => 'oauth.checkrole:deliveryman', 'as' => 'deliveryman.'], function () { Route::resource('order', 'Api\\Deliveryman\\DeliverymanCheckoutController', ['except' => ['create', 'edit', 'destroy', 'store']]); Route::patch('order/{id}/update-status', ['uses' => 'Api\\Deliveryman\\DeliverymanCheckoutController@updateStatus', 'as' => 'orders.update_status']); }); }); Route::post('oauth/access_token', function () { return Response::json(Authorizer::issueAccessToken()); }); });
*/ Route::get('/login', ['as' => 'auth.formLogin', 'uses' => 'Auth\\AuthController@getLogin']); Route::post('/login', ['as' => 'auth.login', 'uses' => 'Auth\\AuthController@postLogin']); Route::get('/logout', ['as' => 'auth.logout', 'uses' => 'Auth\\AuthController@getLogout']); /* * Registration routes */ /* Route::get('/register', ['as' => 'auth.formRegister', 'uses' => 'Auth\AuthController@getRegister']); Route::post('/register', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@postRegister']); */ }); route::group(['prefix' => 'password'], function () { /* * Password reset link request routes */ Route::get('/email', ['as' => 'password.formPassword', 'uses' => 'Auth\\PasswordController@getEmail']); Route::post('/email', 'Auth\\PasswordController@postEmail'); /* * Password reset routes */ Route::get('/reset/{token}', 'Auth\\PasswordController@getReset'); Route::post('/reset', 'Auth\\PasswordController@postReset'); /* * Nova Senha */ Route::group(['middleware' => ['auth', 'needsRole'], 'is' => ['admin', 'gestor'], 'any' => true], function () { Route::get('/senha', ['as' => 'password.getNewpassword', 'uses' => 'Auth\\PasswordController@getNewPassword']); Route::post('/senha', ['as' => 'password.postNewpassword', 'uses' => 'Auth\\PasswordController@postNewPassword']); }); });
return Redirect::to('auth/login'); }); Route::get('home', 'HomeController@index'); Route::controllers(['password' => 'Auth\\PasswordController']); // Authentication routes... Route::get('auth/login', 'Auth\\AuthController@getLogin'); Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); Route::group(['prefix' => 'admin'], function () { /*these has middle ware guest in controller AuthController*/ route::get('/', function () { return Redirect::to('admin/dashboard'); }); Route::get('/logout', 'Admin\\AdminAuthController@getAdminLogout'); route::group(['middleware' => ['admin-guest']], function () { route::get('/login', 'Admin\\AdminAuthController@getAdminLogin'); route::post('/login', 'Admin\\AdminAuthController@postAdminLogin'); }); /*secure admin routes*/ route::group(['middleware' => ['admin-auth']], function () { route::get('/dashboard', 'Admin\\AdminDashboardController@getDashboard'); route::group(['prefix' => 'clients'], function () { route::get('/', 'Admin\\AdminClientsController@getClients'); route::get('/add', 'Admin\\AdminClientsController@getAddClient'); route::post('/add', 'Admin\\AdminClientsController@postAddClient'); }); }); }); // Registration routes...for the users and anybody else are disabled. /*Route::get('auth/register', 'Auth\AuthController@getRegister'); Route::post('auth/register', 'Auth\AuthController@postRegister');*/
// Registration Route::get('daftar', ['as' => 'auth.register.form', 'uses' => 'Auth\\RegistrationController@getRegister']); Route::post('daftar', ['as' => 'auth.register.attempt', 'uses' => 'Auth\\RegistrationController@postRegister']); // Activation Route::get('activate/{code}', ['as' => 'auth.activation.attempt', 'uses' => 'Auth\\RegistrationController@getActivate']); Route::get('resend', ['as' => 'auth.activation.request', 'uses' => 'Auth\\RegistrationController@getResend']); Route::post('resend', ['as' => 'auth.activation.resend', 'uses' => 'Auth\\RegistrationController@postResend']); // Password Reset Route::get('password/reset/{code}', ['as' => 'auth.password.reset.form', 'uses' => 'Auth\\PasswordController@getReset']); Route::post('password/reset/{code}', ['as' => 'auth.password.reset.attempt', 'uses' => 'Auth\\PasswordController@postReset']); Route::get('password/reset', ['as' => 'auth.password.request.form', 'uses' => 'Auth\\PasswordController@getRequest']); Route::post('password/reset', ['as' => 'auth.password.request.attempt', 'uses' => 'Auth\\PasswordController@postRequest']); route::group(['middleware' => ['completedProfil']], function () { Route::get('/', ['as' => 'utama', function () { return view('centaur.dashboard'); }]); //profil Route::get('/{hash}', ['as' => 'profil.show', 'uses' => 'ProfilController@show']); }); //tetapan Route::get('tetapan/profil', ['as' => 'profil.tetapan', 'uses' => 'ProfilController@getProfil']); Route::patch('profil/{id}', ['as' => 'tetapan.profil.update', 'uses' => 'ProfilController@postProfil']); Route::group(['prefix' => 'pentadbir'], function () { Route::resource('dashboard', 'DashboardController'); // Users Route::resource('users', 'UserController'); // Roles Route::get('api/roles', ['as' => 'datatables.roles', 'uses' => 'RoleController@dataTables']); Route::resource('roles', 'RoleController'); }); });
<?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. | */ Route::when('*', 'csrf', ['post']); /*Route::get('/', function () { return view('welcome'); }); */ Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']); Route::get('home', 'HomeController@index'); Route::resource('/', 'FrontController'); route::group(['middleware' => 'auth'], function () { Route::resource('admin/categoria', 'CategoriaControlador'); Route::resource('producto', 'ProductoControlador'); Route::resource('admin/presentacion', 'PresentacionControlador'); //Route::resource('admin/producto','WelcomeController'); });
| 后台通用route |-------------------------------------------------------------------------- */ route::group(array('prefix' => 'shopadmin'), function () { # 系统分类 route::match(array('GET', 'POST'), '/', array('as' => 'shopadmin', 'uses' => 'desktop_router@dispatch')); }); /* |-------------------------------------------------------------------------- | setup |-------------------------------------------------------------------------- */ route::group(array('prefix' => 'setup'), function () { # 安装首页 route::match(array('GET', 'POST'), '/', ['as' => 'setup', 'uses' => 'setup_ctl_default@index']); # 安装页 route::match(array('GET', 'POST'), '/default/process', ['uses' => 'setup_ctl_default@process']); # 命令行安装 route::match(array('GET', 'POST'), '/default/install_app', ['uses' => 'setup_ctl_default@install_app']); # console route::match(array('GET', 'POST'), '/default/console', ['uses' => 'setup_ctl_default@console']); # 激活 route::match(array('GET', 'POST'), '/default/active', ['uses' => 'setup_ctl_default@active']); # 激活成功 route::match(array('GET', 'POST'), '/default/success', ['uses' => 'setup_ctl_default@success']); # 环境初始化 route::match(array('GET', 'POST'), '/default/initenv', ['uses' => 'setup_ctl_default@initenv']); # 女装初始化数据 route::match(array('GET', 'POST'), '/default/install_demodata', ['uses' => 'setup_ctl_default@install_demodata']); route::match(array('GET', 'POST'), '/default/setuptools', ['uses' => 'setup_ctl_default@setuptools']); });