/**
  * @param array $tables
  */
 public static function route(array $tables)
 {
     Route::group(Config::get(TableAdmin::PACKAGE_NAME . '::routing'), function () use($tables) {
         $parameters = ['table' => '(' . implode('|', $tables) . ')'];
         $controller = '\\Shin1x1\\LaravelTableAdmin\\Controller\\TableAdminController';
         Route::get('{table}', $controller . '@index')->where($parameters);
         Route::get('{table}/create', $controller . '@create')->where($parameters);
         Route::post('{table}', $controller . '@store')->where($parameters);
         Route::get('{table}/{id}', $controller . '@edit')->where($parameters);
         Route::put('{table}/{id}', $controller . '@update')->where($parameters);
         Route::delete('{table}/{id}', $controller . '@destroy')->where($parameters);
     });
 }
예제 #2
0
                    Route::get('', 'Urls@index');
                    Route::get('create', 'Urls@create');
                    Route::post('', 'Urls@store');
                    Route::post('{url}/make-primary', 'Urls@makePrimary');
                    Route::delete('{url}', 'Urls@destroy');
                    Route::get('{url}/move', 'Urls@getMove');
                    Route::post('{url}/move', 'Urls@postMove');
                });
                Route::get('tags', 'Tags@view');
                Route::post('tags', 'Tags@add');
                Route::delete('tags/{tag}', 'Tags@remove');
                Route::get('relations', 'Relations@index');
                Route::post('relations/{related}', 'Relations@store');
                Route::delete('relations/{related}', 'Relations@destroy');
                Route::get('acl', 'Acl@index');
                Route::put('acl', 'Acl@update');
                Route::post('acl/{group}', 'Acl@store');
                Route::delete('acl/{group}', 'Acl@destroy');
                Route::get('', 'PageController@getIndex');
            });
        });
    });
});
Route::group(['prefix' => 'asset'], function () {
    Route::get('version/{id}/{width?}/{height?}', ['as' => 'asset-version', 'middleware' => ['web', Middleware\RequireLogin::class], 'uses' => function ($versionId, $width = null, $height = null) {
        $asset = Asset::findByVersionId($versionId);
        return App::make(AssetHelper::controller($asset), [$asset])->view($width, $height);
    }]);
    Route::get('{asset}/download', ['asset' => 'asset-download', 'middleware' => [Middleware\LogAssetDownload::class], 'uses' => function ($asset) {
        return App::make(AssetHelper::controller($asset), [$asset])->download();
    }]);
예제 #3
0
<?php

use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'slots', 'middleware' => ['riot.router', 'riot.resource', 'riot.keys']], function () {
    Route::get('{slot}', 'ResourcesController@show');
    Route::post('{slot}', 'ResourcesController@store');
    // These routes require K1
    Route::group(['middleware' => ['riot.k1auth']], function () {
        Route::get('{slot}/keys/k2', 'KeysController@retrieveK2');
        Route::put('{slot}/keys/k2', 'KeysController@installK2');
    });
});
예제 #4
0
    Route::post('users/{users}/deactivate', 'UserController@deactivate');
    Route::post('users/{id}/activate', 'UserController@activate');
    Route::put('users/{users}', 'UserController@update');
    /*Route::get('orders/{status}', 'OrderController@index');*/
    Route::put('orders/{orders}/deactivate', 'OrderController@deactivate');
    //Route::put('orders/{id}/activate', 'OrderController@activate');
    Route::resource('orders', 'OrderController');
    Route::put('products/{id}/activate', 'ProductController@activate');
    Route::put('products/{products}/deactivate', 'ProductController@deactivate');
    Route::resource('products', 'ProductController');
    Route::get('my-orders', 'HomeController@orders');
    Route::get('my-settings', 'HomeController@settings');
    Route::get('my-profile', 'HomeController@profile');
    Route::put('users/{id}', 'UserController@update');
});
/*Route::group(['prefix' => 'user', 'middleware' => 'auth:employee'], function() {

    //Route::get('orders', 'OrdersController@index');
    Route::get('orders/confirmed', 'OrdersController@confirmed');
});*/
Route::resource('products', 'ProductController');
Route::get('cart', 'CartController@index');
Route::put('cart', 'CartController@update');
Route::delete('cart', 'CartController@destroy');
Route::controllers(['auth' => 'Auth\\AuthController']);
// Password reset link request routes...
Route::get('password/email', 'Auth\\PasswordController@getEmail');
Route::post('password/email', 'Auth\\PasswordController@postEmail');
// Password reset routes...
Route::get('password/reset/{token}', 'Auth\\PasswordController@getReset');
Route::post('password/reset', 'Auth\\PasswordController@postReset');
예제 #5
0
파일: LaCrud.php 프로젝트: devswert/lacrud
 /**
  * Principal function, this method create all routes
  * added in the array declaration on routes.php
  *
  * @param $routes array
  * @return this 
  */
 public function RegisterCrud($routes)
 {
     foreach ($routes as $route => $controller) {
         $table = str_replace("_", "-", is_numeric($route) ? $controller : $route);
         $final = str_replace("_", "-", isset($this->prefix) ? $this->prefix . '/' . $table : $table);
         $entity = new LaCrudBaseEntity();
         $entity->table = is_numeric($route) ? $controller : $route;
         $manager = new LaCrudManager($entity);
         $repository = new LaCrudRepository($entity);
         $repository->routes($routes);
         $config = new Configuration();
         $config->title(ucfirst(is_numeric($route) ? $controller : $route));
         $config->theme($this->theme);
         if (is_array($controller)) {
             $controller = array_key_exists('controller', $controller) ? $controller['controller'] : null;
         }
         $controllerFinalName = $this->getNamespace() . 'Http\\Controllers\\' . $controller;
         $functional = !is_numeric($route) && !is_null($controller) ? new $controllerFinalName($repository, $manager, $config) : new LaCrudController($repository, $manager, $config);
         Route::get($final, array('as' => 'lacrud.' . $table . '.index', function () use($functional) {
             return $functional->index();
         }));
         Route::get($final . '/create', array('as' => 'lacrud.' . $table . '.create', function () use($functional) {
             return $functional->create();
         }));
         Route::post($final, array('as' => 'lacrud.' . $table . '.store', function () use($functional) {
             return $functional->store();
         }));
         Route::get($final . '/{id}', array('as' => 'lacrud.' . $table . '.show', function ($id) use($functional) {
             return $functional->show($id);
         }));
         Route::get($final . '/{id}/edit', array('as' => 'lacrud.' . $table . '.edit', function ($id) use($functional) {
             return $functional->edit($id);
         }));
         Route::put($final . '/{id}', array('as' => 'lacrud.' . $table . '.update', function ($id) use($functional) {
             return $functional->update($id);
         }));
         Route::delete($final . '/{id}', array('as' => 'lacrud.' . $table . '.delete', function ($id) use($functional) {
             return $functional->destroy($id);
         }));
     }
     return $this;
 }
예제 #6
0
|
*/
use Illuminate\Support\Facades\Route;
/*Route::get('/', function () {
    return view('welcome');
});*/
Route::get('/', 'LoginController@index');
Route::post('auth/login', 'LoginController@checking');
Route::get('dashboard', function () {
    return view('dashboard');
});
Route::get('frames', 'FramesController@index');
Route::get('frames/add', 'FramesController@add');
Route::post('frames/insert', 'FramesController@insert');
Route::get('frames/edit/{id}', 'FramesController@edit');
Route::put('frames/update/{id}', 'FramesController@update');
Route::get('frames/delete/{id}', 'FramesController@delete');
Route::get('categories', 'CategoriesController@index');
Route::get('categories/add', 'CategoriesController@add');
Route::post('categories/insert', 'CategoriesController@insert');
Route::get('categories/edit/{id}', 'CategoriesController@edit');
Route::post('categories/update/{id}', 'CategoriesController@update');
Route::get('categories/delete/{id}', 'CategoriesController@delete');
Route::get('hairstyles', 'HairstylesController@index');
Route::get('hairstyles/add', 'HairstylesController@add');
Route::post('hairstyles/insert', 'HairstylesController@insert');
Route::get('hairstyles/edit/{id}', 'HairstylesController@edit');
Route::get('hairstyles/edit/midpoint/{id}', 'HairstylesController@midpoint');
Route::post('hairstyles/update/{id}', 'HairstylesController@update');
Route::post('hairstyles/updatepoint/{id}', 'HairstylesController@updatePoint');
Route::get('hairstyles/delete/{id}', 'HairstylesController@delete');