Exemplo n.º 1
0
<?php

Route::bind('user', function ($id) {
    return App\User::whereId($id)->first();
});
Route::bind('student', function ($id) {
    return App\Student::whereStudentId($id)->first();
});
Route::bind('role', function ($id) {
    return App\Role::whereId($id)->first();
});
Route::bind('information', function ($id) {
    return App\Information::whereId($id)->first();
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| 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('/', ['as' => 'home', 'uses' => 'HomeController@index']);
Route::get('home', ['as' => 'home', 'uses' => 'HomeController@index']);
// AUTH CONTROLLERS
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
// USER
Route::resource('user', 'UserController');
post('update/{user_id}/role', ['as' => 'update_role', 'uses' => 'UserController@updateRoles']);
Exemplo n.º 2
0
    return App\Device::whereSlug($slug)->first();
});
Route::bind('status', function ($slug) {
    return App\Status::whereSlug($slug)->first();
});
Route::bind('owner', function ($slug) {
    return App\Owner::whereSlug($slug)->first();
});
Route::bind('user', function ($id) {
    return App\User::find($id);
});
Route::bind('note', function ($id) {
    return App\Note::find($id);
});
Route::bind('information', function ($id) {
    return App\Information::find($id);
});
Route::bind('field', function ($id) {
    return App\Field::find($id);
});
Route::bind('activity', function ($id) {
    return App\Activity::find($id);
});
# ROUTE RESOURCE
# CATEGORY RESOURCE
Route::resource('category', 'CategoryController');
Route::get('change_password', ['as' => 'change_password', 'uses' => 'UserController@viewChangePassword']);
// GET
get('{category_slug}/category_history', ['as' => 'c_h', 'uses' => 'CategoryController@categoryHistory']);
get('{category_slug}/associate-dissociate-history', ['as' => 'ch', 'uses' => 'CategoryController@viewCategoryHistory']);
get('{category_slug}/statuses', ['as' => 'sh', 'uses' => 'CategoryController@viewCategoryStatusesHistory']);