本文整理汇总了PHP中Illuminate\Support\Facades\Route::controllers方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::controllers方法的具体用法?PHP Route::controllers怎么用?PHP Route::controllers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Route
的用法示例。
在下文中一共展示了Route::controllers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$faucets = DB::table('faucets')->orderBy('name', 'asc')->get();
// set your feed's title, description, link, pubdate and language
$feed->title = 'FreeBTC.Website Bitcoin Faucet Rotator Feed';
$feed->description = 'The Atom/RSS feed which shows the latest bitcoin faucets.';
$feed->link = URL::to('feed');
$feed->setDateFormat('datetime');
// 'datetime', 'timestamp' or 'carbon'
$feed->pubdate = $faucets[0]->created_at;
$feed->lang = 'en';
$feed->setShortening(true);
// true or false
$feed->setTextLimit(100);
// maximum length of description text
foreach ($faucets as $faucet) {
$title = isset($faucet->meta_title) == true ? $faucet->meta_title : $faucet->name;
// set item's title, author, url, pubdate, description and content
$feed->add($title, 'FreeBTC.Website Bitcoin Faucet Rotator', URL::to('/faucets/' . $faucet->slug), $faucet->created_at, str_replace('&', ' and ', $faucet->meta_description), $faucet->meta_description);
}
$payment_processors = DB::table('payment_processors')->orderBy('name', 'asc')->get();
foreach ($payment_processors as $p) {
$title = isset($p->meta_title) == true ? $p->meta_title : $p->name;
// set item's title, author, url, pubdate, description and content
$feed->add($title, $p->name, URL::to('/payment_processors/' . $p->slug), $p->created_at, str_replace('&', ' and ', $p->meta_description), $p->meta_description);
$rotator = URL::to("/payment_processors/" . $p->slug . '/rotator');
$feed->add($title, $p->name, $rotator, $p->created_at, $p->name . ' Faucet Rotator', 'Earn free bitcoins from faucets that use "' . $p->name . '" as a payment processor.');
}
return $feed->render('atom');
//}
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
示例2: function
<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in 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.
|
*/
use Illuminate\Support\Facades\Route;
Route::controllers(['test' => 'Test\\TestController', 'login' => 'Login\\LoginController']);
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web', 'test']], function () {
//
Route::match(['get', 'post'], '/web/{number}', function ($number) {
return Response::json(['test']);
});
});
Route::group(['middleware' => 'web'], function () {
示例3:
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');