当前位置: 首页>>代码示例>>PHP>>正文


PHP Route::delete方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Route::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::delete方法的具体用法?PHP Route::delete怎么用?PHP Route::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Route的用法示例。


在下文中一共展示了Route::delete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
     });
 }
开发者ID:shin1x1,项目名称:laravel-table-admin,代码行数:16,代码来源:TableAdminFacade.php

示例2: function

                    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();
    }]);
    Route::get('{asset}/{action}.{extension}', ['as' => 'asset', 'middleware' => [Middleware\CheckAssetETag::class], 'uses' => function ($asset, $action = 'view', $width = null, $height = null) {
        return App::make(AssetHelper::controller($asset), [$asset])->{$action}($width, $height);
开发者ID:boomcms,项目名称:boom-core,代码行数:31,代码来源:routes.php

示例3: array

        Route::get('users/{id}/edit', array('uses' => 'UsersController@edit'));
        Route::patch('users/{id}/edit', array('uses' => 'UsersController@update'));
        Route::delete('users/{id}', array('uses' => 'UsersController@destroy'));
        Route::get('groups/create', array('uses' => 'GroupsController@create'));
        Route::post('groups', array('uses' => 'GroupsController@store'));
        Route::get('groups/{id}', array('uses' => 'GroupsController@show'));
        Route::get('groups/{id}/edit', array('uses' => 'GroupsController@edit'));
        Route::patch('groups/{id}/edit', array('uses' => 'GroupsController@update'));
        Route::delete('groups/{id}', array('uses' => 'GroupsController@destroy'));
        Route::post('manage/groups/{groupId}/add/{userId}', array('uses' => 'UsersGroupsController@addUserToGroup'));
        Route::post('manage/groups/{groupId}/remove/{userId}', array('uses' => 'UsersGroupsController@removeUserFromGroup'));
    });
    //Website
    Route::group(['prefix' => 'website'], function () {
        Route::get('/', array('uses' => 'WebsiteController@index'));
        Route::get('create', array('uses' => 'WebsiteController@create'));
        Route::post('create', array('uses' => 'WebsiteController@store'));
        Route::delete('delete', array('uses' => 'WebsiteController@destroy'));
    });
    //CRM
    Route::group(['prefix' => 'crm'], function () {
        Route::get('/', array('uses' => 'CrmController@index'));
        Route::post('crm/activate', ['as' => 'crm.activate', 'uses' => 'CrmController@activateCRM']);
        Route::post('crm/create/user/{id}', ['as' => 'crm.activate', 'uses' => 'CrmController@createUser']);
        Route::post('crm/disable', ['as' => 'crm.activate', 'uses' => 'CrmController@disableCRM']);
        Route::post('crm/reactivate', ['as' => 'crm.activate', 'uses' => 'CrmController@reactivateCRM']);
        Route::get('crm/status', ['as' => 'crm.activate', 'uses' => 'CrmController@checkAvailabilityCRM']);
        Route::post('crm/users/toogle/{id}', ['as' => 'crm.activate', 'uses' => 'CrmController@toogleUserCRM']);
        Route::get('crm/users', ['as' => 'crm.activate', 'uses' => 'CrmController@getUsersCRM']);
    });
});
开发者ID:iris-it,项目名称:irispass-webapp-laravel,代码行数:31,代码来源:routes.php

示例4: view

            return view('tasks', ['tasks' => $tasks]);
        });*/
    Route::get('/', 'UserController@index');
    Route::get('/tasks', 'TaskController@index');
    Route::get('/phone', 'PhoneController@index');
    Route::get('/posts', 'PostController@index');
    Route::get('/comment', 'CommentController@index');
    Route::get('/roles', 'RoleController@index');
    //    Route::post('/task', 'TaskController@store');
    /**
     * Create Task
     */
    Route::post('/task', function (Request $request) {
        $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
        if ($validator->fails()) {
            return redirect('/')->withInput()->withErrors($validator);
        }
        //Create New Tasks
        $task = new Task();
        $task->name = $request->name;
        $task->save();
        return redirect('/');
    });
    /**
     * Delete Task
     */
    Route::delete('/task/{task}', function (Task $task) {
        $task->delete();
        return redirect('/');
    });
});
开发者ID:sh6210,项目名称:laravel-beginner-tutorial,代码行数:31,代码来源:routes.php

示例5: function

<?php

use Illuminate\Support\Facades\Route;
Route::get('/', function () {
    return view('app');
});
Route::post('oauth/access_token', function () {
    return Response::json(Authorizer::issueAccessToken());
});
/**
 * Aplique o processo de Autorização em todos os endpoints de nossa API
 */
Route::group(['middleware' => 'oauth'], function () {
    Route::resource('client', 'ClientController', ['except' => ['create', 'edit']]);
    Route::resource('project', 'ProjectController', ['except' => ['create', 'edit']]);
    Route::resource('project.notes', 'ProjectNoteController', ['except' => ['create', ' edit']]);
    Route::resource('project.task', 'ProjectTaskController', ['except' => ['create', 'edit']]);
    Route::resource('project.members', 'ProjectMemberController', ['only' => ['index', 'store', 'show', 'destroy']]);
    Route::post('project/{id}/file', 'ProjectFileController@store');
    Route::delete('project/{id}/file/{file_id}', 'ProjectFileController@destroy');
    Route::get('user/authenticated', 'UserController@authenticated');
});
开发者ID:hugosv,项目名称:codeproject-curso,代码行数:22,代码来源:routes.php

示例6:

    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');
开发者ID:vidmahovic,项目名称:ep-store,代码行数:31,代码来源:routes.php

示例7: 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;
 }
开发者ID:devswert,项目名称:lacrud,代码行数:49,代码来源:LaCrud.php

示例8: registerRoutes

 protected function registerRoutes()
 {
     Route::get('api/profiler/profiles', ['as' => 'profiler.profiles.list', 'uses' => ProfilerController::class . '@index']);
     Route::get('api/profiler/profiles/{id}', ['as' => 'profiler.profiles.show', 'uses' => ProfilerController::class . '@show']);
     Route::delete('api/profiler/profiles', ['as' => 'profiler.profiles.clear', 'uses' => ProfilerController::class . '@clear']);
 }
开发者ID:ndrx-io,项目名称:profiler-laravel,代码行数:6,代码来源:LaravelProfilerServiceProvider.php


注:本文中的Illuminate\Support\Facades\Route::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。