本文整理汇总了PHP中Illuminate\Routing\Router::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::model方法的具体用法?PHP Router::model怎么用?PHP Router::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Routing\Router
的用法示例。
在下文中一共展示了Router::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Boot the application events.
*
* @return void
*/
public function boot(Router $router)
{
$router->model('uuser', '\\Modules\\Users\\Entities\\User');
$router->model('urole', '\\Bican\\Roles\\Models\\Role');
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
Relation::morphMap(['users' => \Modules\Users\Entities\User::class]);
}
示例2: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->model('school', School::class);
$router->model('inscription', Inscription::class);
$router->model('student', Student::class);
parent::boot($router);
}
示例3: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
//models bind
$router->model('product', Product::class);
$router->model('category', Category::class);
parent::boot($router);
}
示例4: boot
/**
* ルートモデル結合、パターンフィルターなどを定義
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->model('textDiary', TextDiary::class);
$router->model('workDiary', WorkDiary::class);
$router->model('workRecord', WorkRecord::class);
parent::boot($router);
}
示例5: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->bind('article', function ($value) {
return $this->getArticle()->where('slug', $value)->firstOrFail();
});
$router->bind('cong-ty', function ($value) {
return \App\Company::where('slug', $value)->firstOrFail();
});
$router->bind('thiet-ke-thi-cong', function ($value) {
return $this->designModel->getDesigns()->where('designs.slug', $value)->firstOrFail();
});
$router->bind('house', function ($value) {
return $this->houseModel->getHouses()->where('houses.slug', $value)->firstOrFail();
});
$router->bind('company', function ($value) {
return \App\Company::where('slug', $value)->firstOrFail();
});
$router->bind('project', function ($value) {
return $this->projectModel->getProjects()->where('projects.slug', $value)->firstOrFail();
});
$router->model('owner', 'App\\House');
$router->model('agency', 'App\\House');
$router->model('message', 'App\\Message');
parent::boot($router);
}
示例6: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->model('post', Post::class);
$router->model('user', User::class);
$router->model('category', Category::class);
parent::boot($router);
}
示例7: defineRoutes
private function defineRoutes()
{
$this->router->model("role_id", "UserManagement\\Role");
$this->router->group(["prefix" => "/dashboard/user", "namespace" => "UserManagement"], function () {
$this->router->get('role', ['as' => 'role.index', 'uses' => 'RoleController@index']);
$this->router->get('role/create', ['as' => 'role.create', 'uses' => 'RoleController@create']);
$this->router->post('role/create', ['as' => 'role.create.post', 'uses' => 'RoleController@postCreate']);
$this->router->get('role/update/{role_id}', ['as' => 'role.update', 'uses' => 'RoleController@update']);
$this->router->post('role/update/{role_id}', ['as' => 'role.update.post', 'uses' => 'RoleController@postUpdate']);
$this->router->get('role/delete/{role_id}', ['as' => 'role.delete', 'uses' => 'RoleController@delete']);
$this->router->get('permission/', ['as' => 'permission.index', 'uses' => 'PermissionController@index']);
$this->router->model("user_id", "UserManagement\\UserModel");
$this->router->get("/", ['as' => 'user.index', 'uses' => 'UserController@index']);
$this->router->get("/create", ['as' => 'user.create', 'uses' => 'UserController@create']);
$this->router->post("/create", ['as' => 'user.create.post', 'uses' => 'UserController@postCreate']);
$this->router->get("/update/{user_id}", ['as' => 'user.update', 'uses' => 'UserController@update']);
$this->router->post("/update/{user_id}", ['as' => 'user.update.post', 'uses' => 'UserController@postUpdate']);
$this->router->get("/delete/{user_id}", ['as' => 'user.delete', 'uses' => 'UserController@delete']);
});
$this->router->group(["namespace" => "UserManagement"], function () {
$this->router->get("/login", ['as' => 'login', 'uses' => 'UserController@login']);
$this->router->post("/login", ['as' => 'login.post', 'uses' => 'UserController@postLogin']);
$this->router->get("/logout", ['as' => 'logout', 'uses' => 'UserController@logout']);
$this->router->get("/register", ['as' => 'register', 'uses' => 'UserController@register']);
$this->router->post("/register", ['as' => 'register.post', 'uses' => 'UserController@postRegister']);
});
}
示例8: defineRoutes
private function defineRoutes()
{
$this->router->group(['namespace' => "FileManager"], function () {
$this->router->get('dashboard/filemanager', ['as' => 'filemanager.index', 'uses' => 'FileController@getFileManager']);
});
$this->router->group(['prefix' => "dashboard/file", 'namespace' => "FileManager"], function () {
$this->router->model("file_id", File::class);
$this->router->get('/', ['as' => 'file.all', 'uses' => 'FileController@getIndex']);
$this->router->get('/get', ['as' => 'file.getFile', 'uses' => 'FileController@getFile']);
$this->router->get('/add', ['as' => 'file.index', 'uses' => 'FileController@getFileAdd']);
$this->router->get('/edit/{file_id}', ['as' => 'file.edit', 'uses' => 'FileController@getEdit']);
$this->router->get('/manage', ['as' => 'file.manage', 'uses' => 'FileController@getManage']);
$this->router->post('/edit/{file_id}', 'FileController@fileEdit');
$this->router->post('/add', ['as' => 'file.add', 'uses' => 'FileController@postFileAdd']);
$this->router->post('/delete', ['as' => 'file.delete', 'uses' => 'FileController@postDelete']);
$this->router->get('/rename/{file_id}', ['as' => 'file.rename', 'uses' => 'FileController@getFileRename']);
$this->router->post('/rename', ['as' => 'file.rename', 'uses' => 'FileController@postFileRename']);
$this->router->get('/crop/{file_id}', ['as' => 'file.crop', 'uses' => 'FileController@getFileCrop']);
$this->router->post('/crop/{file_id}', ['as' => 'file.crop', 'uses' => 'FileController@postFileCrop']);
$this->router->post('/multiPost', ['as' => 'file.multipleFiles', 'uses' => 'FileController@postMultipleFiles']);
$this->router->get('/list', ['as' => 'file.list', 'uses' => 'FileController@getList']);
});
$this->router->group(['prefix' => "dashboard/folder", 'namespace' => "FileManager"], function () {
$this->router->model("folder_id", Folder::class);
$this->router->get('/index', ['as' => 'folder.all', 'uses' => 'FolderController@getIndex']);
$this->router->get('/add', ['as' => 'folder.add', 'uses' => 'FolderController@getFolderAdd']);
$this->router->get('/edit/{folder_id}', ['as' => 'folder.edit', 'uses' => 'FolderController@getFolderEdit']);
$this->router->get('/manage', ['as' => 'folder.manage', 'uses' => 'FolderController@getFolderManage']);
$this->router->post('/delete', ['as' => 'folder.delete', 'uses' => 'FolderController@postDelete']);
$this->router->post('/add', ['as' => 'folder.add', 'uses' => 'FolderController@postFolderAdd']);
$this->router->post('/edit', ['as' => 'folder.rename', 'uses' => 'FolderController@postFolderRename']);
$this->router->get('/list', ['as' => 'folder.list', 'uses' => 'FolderController@getList']);
});
}
示例9: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->pattern('board', Board::URI_PATTERN);
$router->model('board', 'App\\Board');
$router->model('role', 'App\\Role');
parent::boot($router);
}
示例10: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->model('batch', 'App\\Batch');
$router->model('parcel', 'App\\Parcels');
$router->model('users', 'App\\User');
parent::boot($router);
}
示例11: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
*/
public function boot(Router $router)
{
$router->model('generators', 'Education\\Entities\\Generator');
$router->model('questions', 'Education\\Entities\\Question');
$router->model('generated-protocols', 'Education\\Entities\\GeneratedProtocol');
parent::boot($router);
}
示例12: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$router->model('task', 'App\\Task');
$router->model('profile', 'App\\Profile');
$router->model('person', 'App\\Person');
$router->model('phone', 'App\\Phone');
parent::boot($router);
}
示例13: boot
public function boot(Router $router)
{
$router->model('asset', Models\Asset::class);
$router->model('page', Models\Page::class);
$router->model('group', Models\Group::class);
$router->model('template', Models\Template::class);
$router->model('url', Models\URL::class);
require __DIR__ . '/../../routes.php';
}
示例14: boot
/**
* Boot the application events.
*
* @return void
*/
public function boot(Router $router)
{
$router->model('uuser', '\\Modules\\Users\\Entities\\User');
$router->model('urole', '\\Bican\\Roles\\Models\\Role');
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->registerMenu();
}
示例15: boot
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
//
$router->model('users', 'App\\User');
$router->model('examinee', 'App\\User');
$router->model('quizzes', 'App\\Quiz');
$router->model('tests', 'App\\Test');
parent::boot($router);
}