本文整理汇总了PHP中Illuminate\Support\Facades\Route::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Route::model方法的具体用法?PHP Route::model怎么用?PHP Route::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Route
的用法示例。
在下文中一共展示了Route::model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->configureDatabase();
Route::model('real', 'Propaganistas\\LaravelFakeId\\Tests\\Real');
Route::fakeIdModel('fake', 'Propaganistas\\LaravelFakeId\\Tests\\Fake');
Route::get('real/{real}', ['as' => 'real', function ($real) {
return 'real';
}]);
Route::get('fake/{fake}', ['as' => 'fake', function ($fake) {
return 'fake';
}]);
}
示例2: defineRouteBindings
/**
* Define the Spark route model bindings.
*
* @return void
*/
protected function defineRouteBindings()
{
Route::model('team', Spark::teamModel());
Route::model('team_member', Spark::userModel());
}
示例3: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
parent::boot();
Route::model('user', User::class);
Route::model('role', Role::class);
}
示例4:
<?php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;
Route::model('user', Config::get('auth.model'));
Route::resource('/admin/user', 'ZaLaravel\\LaravelUser\\Controllers\\AdminUserController');
Route::post('/admin/user/{user}/block', ['uses' => 'ZaLaravel\\LaravelUser\\Controllers\\AdminUserController@block', 'as' => 'admin.user.block']);