當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Router::model方法代碼示例

本文整理匯總了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]);
 }
開發者ID:hisambahaa,項目名稱:DARES,代碼行數:14,代碼來源:UsersServiceProvider.php

示例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);
 }
開發者ID:afelipelc,項目名稱:Bachilleratos-Digitales-Laravel,代碼行數:13,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:rajinha92,項目名稱:laravel-skills-test2,代碼行數:13,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:nana4rider,項目名稱:mdiary,代碼行數:13,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:khanhpnk,項目名稱:sbds,代碼行數:31,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:vaiveg,項目名稱:vaiva-blog,代碼行數:13,代碼來源:RouteServiceProvider.php

示例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']);
     });
 }
開發者ID:PhonemeCms,項目名稱:cms,代碼行數:27,代碼來源:PermissionServiceProvider.php

示例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']);
     });
 }
開發者ID:PhonemeCms,項目名稱:cms,代碼行數:34,代碼來源:FileManagerServiceProvider.php

示例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);
 }
開發者ID:Ryangr0,項目名稱:infinity-next,代碼行數:13,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:richardkeep,項目名稱:tracker,代碼行數:13,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:andrestntx,項目名稱:Education,代碼行數:12,代碼來源:RouteServiceProvider.php

示例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);
 }
開發者ID:nveeed,項目名稱:laravel-sandbox,代碼行數:14,代碼來源:RouteServiceProvider.php

示例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';
 }
開發者ID:robbytaylor,項目名稱:boom-core,代碼行數:9,代碼來源:RouteServiceProvider.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();
 }
開發者ID:alkindi91,項目名稱:DARES,代碼行數:14,代碼來源:UsersServiceProvider.php

示例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);
 }
開發者ID:richardkeep,項目名稱:quiz,代碼行數:15,代碼來源:RouteServiceProvider.php


注:本文中的Illuminate\Routing\Router::model方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。