本文整理汇总了PHP中Illuminate\Support\Facades\Route::put方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::put方法的具体用法?PHP Route::put怎么用?PHP Route::put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Route
的用法示例。
在下文中一共展示了Route::put方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: route
/**
* @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: function
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: function
<?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:
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: RegisterCrud
/**
* 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: view
|
*/
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');