本文整理汇总了PHP中Route::post方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::post方法的具体用法?PHP Route::post怎么用?PHP Route::post使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route::post方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
Route::post('/user', ['middleware' => 'validate:App\\Http\\Validators\\UserValidate', function () {
return response()->json(null, 200);
}]);
}
示例2: setRoutes
public function setRoutes()
{
$pages = collect(\Config::get('pages'));
foreach ($pages as $page) {
if (!$page['uses']) {
continue;
}
switch ($page['method']) {
case 'get':
\Route::get($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
break;
case 'post':
\Route::post($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
break;
case 'patch':
\Route::patch($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
break;
case 'delete':
\Route::patch($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
break;
case 'any':
\Route::any($this->getUri($page), ['as' => $this->getName($page), 'uses' => $page['uses']]);
}
}
}
示例3: registerRoutes
private function registerRoutes()
{
Route::get('/account', MainController::class . '@index');
Route::get('/account/forms/fields', MainController::class . '@forms');
Route::post('/account/forms/user', MainController::class . '@formUser');
Route::post('/account/forms/password', MainController::class . '@formPassword');
Route::post('/account/forms/card/save', MainController::class . '@formCardSave');
Route::post('/account/forms/autopay/save', MainController::class . '@formAutopaySave');
Route::post('/account/forms/card/remove', MainController::class . '@formCardRemove');
Route::get('/account/orders', MainController::class . '@orders');
Route::get('/account/history', MainController::class . '@history');
Route::get('/account/order/{id}', MainController::class . '@order');
Route::get('/account/order/services/{id}', MainController::class . '@orderServices');
Route::get('/account/order/services/pdf/{id}', MainController::class . '@orderServicesPdf');
Route::get('/account/pay/init/{id}/{target}/{reset}', MainController::class . '@pay');
Route::get('/account/new_card', MainController::class . '@newCard');
Route::post('/account/delete_card', MainController::class . '@deleteCard');
Route::post('/account/autopay', MainController::class . '@autopay');
Route::post('/account/pay_finish', MainController::class . '@payFinish');
Route::get('/account/pay/card', MainController::class . '@card');
Route::get('/account/prepayment', MainController::class . '@prepayment');
Route::post('/account/pay_by_token', MainController::class . '@payByToken');
Route::get('/account/pay/check/{id}', MainController::class . '@checkPay');
Route::post('/account/pay/token', MainController::class . '@token');
Route::post('/account/pay/refund', MainController::class . '@refund');
Route::get('/account/flash/message/{type}', ServiceController::class . '@flash');
Route::get('/account/bonus', MainController::class . '@bonus');
Route::get('/account/order/review/{id}', MainController::class . '@review');
Route::post('/account/order/review', MainController::class . '@reviewOrder');
Route::get('/account/subscriptions', MainController::class . '@subscriptions');
Route::get('/account/customers_cards', MainController::class . '@customersCards');
Route::get('/account/lang/{lang}', ['as' => 'lang.set', 'before' => 'lang.set', function () {
return App::getLocale();
}]);
}
示例4: boot
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('kkstudio/blog');
\Route::get('blog', '\\Kkstudio\\Blog\\Controllers\\BlogController@index');
\Route::get('blog/category/{slug}', '\\Kkstudio\\Blog\\Controllers\\BlogController@fromCategory');
\Route::get('blog/{slug}', '\\Kkstudio\\Blog\\Controllers\\BlogController@show');
\Route::group(['prefix' => 'admin', 'before' => 'admin'], function () {
\Route::get('blog', '\\Kkstudio\\Blog\\Controllers\\BlogController@admin');
\Route::get('blog/create', '\\Kkstudio\\Blog\\Controllers\\BlogController@create');
\Route::post('blog/create', '\\Kkstudio\\Blog\\Controllers\\BlogController@postCreate');
\Route::get('blog/{slug}/edit', '\\Kkstudio\\Blog\\Controllers\\BlogController@edit');
\Route::post('blog/{slug}/edit', '\\Kkstudio\\Blog\\Controllers\\BlogController@postEdit');
\Route::get('blog/{slug}/delete', '\\Kkstudio\\Blog\\Controllers\\BlogController@delete');
\Route::post('blog/{slug}/delete', '\\Kkstudio\\Blog\\Controllers\\BlogController@postDelete');
// Categories
\Route::get('blog/categories', '\\Kkstudio\\Blog\\Controllers\\BlogController@categories');
\Route::get('blog/categories/create', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_create');
\Route::post('blog/categories/create', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_postCreate');
\Route::get('blog/categories/{slug}/edit', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_edit');
\Route::post('blog/categories/{slug}/edit', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_postEdit');
\Route::get('blog/categories/{slug}/delete', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_delete');
\Route::post('blog/categories/{slug}/delete', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_postDelete');
\Route::post('blog/categories/swap', '\\Kkstudio\\Blog\\Controllers\\BlogController@category_swap');
});
}
示例5: setUp
public function setUp()
{
parent::setUp();
Route::post('/comments', ['middleware' => 'camelToSnake', function (Request $request) {
return response()->json($request->all(), 200);
}]);
}
示例6: setUpRoutes
/**
* @param \Illuminate\Foundation\Application $app
*/
protected function setUpRoutes($app)
{
\Route::get('/', ['middleware' => 'localize', function () {
return 'Whoops';
}]);
\Route::get('/ca', ['middleware' => 'localize', function () {
return 'Whoops ca';
}]);
\Route::post('/', ['middleware' => 'localize', function () {
return 'POST answer';
}]);
\Route::get('/es', ['middleware' => 'localize', function () {
return 'Hola mundo';
}]);
\Route::get('/en', ['middleware' => 'localize', function () {
return 'Hello world';
}]);
\Route::get('/en/locale', ['middleware' => 'localize', function () {
return \App::getLocale();
}]);
\Route::get('/es/locale', ['middleware' => 'localize', function () {
return \App::getLocale();
}]);
\Route::get('/api/v1/en/locale', ['middleware' => 'localize:2', function () {
return \App::getLocale();
}]);
\Route::get('/api/v1/es/locale', ['middleware' => 'localize:2', function () {
return \App::getLocale();
}]);
\Route::get('/api/v1/ca/locale', ['middleware' => 'localize:2', function () {
return 'Whoops ca';
}]);
}
示例7: returnRoutes
public static function returnRoutes()
{
$class = __CLASS__;
Route::group(array('before' => 'guest', 'prefix' => ''), function () use($class) {
Route::post('social-signin', array('as' => 'signin.ulogin', 'uses' => $class . '@postUlogin'));
});
}
示例8: routes
function routes($config)
{
// only mess with the cms
Route::group(['prefix' => $config['cms_path'], 'middleware' => ['cms.language', 'cms.view']], function () use($config) {
Route::group(['namespace' => '\\Thorazine\\Cms\\Http\\Controllers'], function () use($config) {
// pickup on first contact
Route::get('/', ['as' => 'cms.auth.first', 'uses' => 'AuthController@first']);
Route::post('/', ['as' => 'cms.auth.first.create', 'uses' => 'AuthController@create']);
// auth
Route::post('/login/submit', ['as' => 'cms.auth.check', 'before' => 'csrf', 'uses' => 'AuthController@check']);
Route::get('/login', ['as' => 'cms.auth.login', 'uses' => 'AuthController@index']);
// All routes that do require auth
Route::group(['middleware' => ['cms.auth']], function () use($config) {
// logout
Route::get('/logout', ['as' => 'cms.auth.logout', 'uses' => 'AuthController@destroy']);
// cms home
Route::get('/base', ['as' => 'cms.base', 'uses' => 'CmsController@index']);
// flexible auth routes
Route::group(['middleware' => ['cms.model']], function () use($config) {
// flexible restfull routes
Route::get('/{module}/{model}/index', ['as' => 'module.model.index', 'uses' => 'PreController@index']);
Route::get('/{module}/{model}/create', ['as' => 'module.model.create', 'uses' => 'PreController@create']);
Route::post('/{module}/{model}/store', ['as' => 'module.model.store', 'uses' => 'PreController@store']);
Route::get('/{module}/{model}/show/{id}', ['as' => 'module.model.show', 'uses' => 'PreController@show']);
Route::get('/{module}/{model}/edit/{id}', ['as' => 'module.model.edit', 'uses' => 'PreController@edit']);
Route::put('/{module}/{model}/update/{id}', ['as' => 'module.model.update', 'uses' => 'PreController@update']);
Route::delete('/{module}/{model}/destroy/{id}', ['as' => 'module.model.destroy', 'uses' => 'PreController@destroy']);
Route::post('/{module}/{model}/order', ['as' => 'module.model.order', 'uses' => 'PreController@order']);
Route::get('/{module}/{model}/{action}', ['as' => 'module.model.action', 'uses' => 'PreController@custom']);
});
});
});
});
}
示例9: setUp
public function setUp()
{
$this->assertInstanceOf('Supermon\\Url\\Uri', Route::get('test', 'test', 'test'));
$this->assertInstanceOf('Supermon\\Url\\Uri', Route::post('test', 'test', 'test'));
Route::get('test/{var}', 'testvar', 'testvar')->where('var', '[0-9]+');
parent::setUp();
}
示例10: setRoutes
public static function setRoutes($routes)
{
foreach ($routes as $c) {
if (class_exists($c->action)) {
if ($c->route_name == '/') {
$routable = \Route::getInspector()->getRoutable($c->action, '');
} else {
$routable = \Route::getInspector()->getRoutable($c->action, $c->route_name);
}
foreach ($routable as $k => $v) {
if ($v[0]['verb'] == 'get') {
if (isset($v[1])) {
if ($v[1]['plain'] == '') {
\Route::get('/', ['as' => '/', 'uses' => $c->action . '@' . $k]);
} else {
\Route::get($v[1]['plain'], ['as' => $v[1]['plain'], 'uses' => $c->action . '@' . $k]);
}
continue;
}
\Route::get($v[0]['plain'], ['as' => $v[0]['plain'], 'uses' => $c->action . '@' . $k]);
} elseif ($v[0]['verb'] == 'post') {
if (preg_match('/[\\s\\S]+\\/index/', $v[0]['plain'])) {
$v[0]['plain'] = str_replace('/index', '', $v[0]['plain']);
}
\Route::post($v[0]['plain'], ['as' => $v[0]['plain'], 'uses' => $c->action . '@' . $k]);
}
}
if ($c->other_route != '') {
\Route::controller($c->other_route, $c->action);
}
}
}
}
示例11: returnRoutes
public static function returnRoutes($prefix = null)
{
$class = __CLASS__;
#Route::get('import', array('uses' => $class . '@import'));
Route::get('ya-feed', array('as' => 'yandex-feed', 'uses' => $class . '@yandexFeed'));
Route::post('click-tracker', array('as' => 'click.tracker', 'uses' => $class . '@clickTracker'));
Route::post('buildings/set-filter', array('as' => 'buildings.filter', 'uses' => $class . '@setBuildingFilter'));
}
示例12: routeAllToJsonrpc
public function routeAllToJsonrpc()
{
\App::before(function () {
\Route::post('{all}', function ($path) {
return \App::make('Leeb\\Jsonrpc\\Interfaces\\RouterInterface')->route();
})->where('all', '.*');
});
}
示例13: boot
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('kkstudio/info');
\Route::group(['before' => 'admin'], function () {
\Route::get('admin/info', '\\Kkstudio\\Info\\Controllers\\InfoController@admin');
\Route::post('admin/info', '\\Kkstudio\\Info\\Controllers\\InfoController@edit');
});
}
示例14: returnRoutes
public static function returnRoutes()
{
$class = __CLASS__;
Route::group(array('before' => 'user.auth', 'prefix' => 'participant'), function () use($class) {
Route::get('profile', array('as' => 'profile.edit', 'uses' => $class . '@profileEdit'));
Route::get('tell-story', array('as' => 'profile.tell-story', 'uses' => $class . '@tellStory'));
Route::post('profile', array('as' => 'profile.save', 'uses' => $class . '@profileSave'));
});
}
示例15: returnRoutes
public static function returnRoutes($prefix = null)
{
$class = __CLASS__;
Route::post('admin/gallery/ajax-order-save', array('as' => 'gallery.order', 'uses' => $class . "@postAjaxOrderSave"));
Route::group(array('before' => 'auth', 'prefix' => $prefix), function () use($class) {
Route::get($class::$group . '/manage', array('uses' => $class . '@getIndex'));
Route::controller($class::$group, $class);
});
}