コード例 #1
0
ファイル: routes.php プロジェクト: novanabs/portofolio-apps
/**==========================  User    =========================================================================================================================*/
Route::bind('user', function ($name) {
    return App\User::whereName($name)->first();
});
$router->resource('user', 'userController');
/**===========================  Profile  ========================================================================================================================*/
Route::get('account-setting', ['as' => 'account.setting', 'uses' => 'profileController@accountSetting']);
$router->resource('profile', 'profileController');
/**===========================  Profile  ========================================================================================================================*/
$router->resource('admin', 'adminController');
/**========================  Article ===========================================================================================================================*/
Route::bind('article', function ($slug) {
    return App\Article::whereSlug($slug)->first();
});
Route::bind('user/article', function ($slug) {
    return App\Article::whereSlug($slug)->first();
});
Route::get('All-Articles', ['as' => 'all.article', 'uses' => 'ArticleController@AllArticle']);
$router->resource('article', 'ArticleController');
$router->resource('user/article', 'userArticleController');
Route::get('{user}/article', ['as' => 'user.article.index', 'uses' => 'userController@showArticle']);
/**=============== Review  ====================================================================================================================================*/
$router->resource('review', 'reviewController');
/**=============== Dan lain lain  ====================================================================================================================================*/
Route::bind('AppCategories', function ($name) {
    return App\AppCategory::whereName($name)->first();
});
Route::bind('ArticleCategories', function ($name) {
    return App\ArticleCategory::whereName($name)->first();
});
Route::resource('AppCategories', 'AppCategoryController');
コード例 #2
0
ファイル: routes.php プロジェクト: schen2011/laravel
|
| Here is where you can register all of the routes for 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.
|
*/
Route::get('/', function () {
    return view('welcome');
});
Route::model('tasks', 'Task');
Route::model('projects', 'Project');
Route::resource('projects', 'ProjectsController');
Route::resource('projects.tasks', 'TasksController');
Route::bind('tasks', function ($value, $route) {
    return App\Task::whereSlug($value)->first();
});
Route::bind('projects', function ($value, $route) {
    return App\Project::whereSlug($value)->first();
});
Route::model('articles', 'Article');
Route::resource('articles', 'ArticlesController');
Route::bind('articles', function ($value, $route) {
    return App\Article::whereSlug($value)->first();
});
Route::model('userkeys', 'UserKey');
Route::resource('userkeys', 'UserKeyController');
Route::bind('userapikeymapping', function ($value, $route) {
    return App\UserKey::all();
});
Route:
get('display', 'ProjectsController@display');