Exemplo n.º 1
0
/*
|--------------------------------------------------------------------------
| 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("/users", function () {
    return \App\User::all();
});
Route::get("/components", function () {
    return \App\Component::all();
});
Route::get("/post/{id}", "PostController@get_single");
Route::get('/login', array('as' => 'user_login', 'uses' => 'UserController@get_login'));
Route::post('/login', array('as' => 'user_login', 'uses' => 'UserController@post_login'));
Route::get('/logout', array('as' => 'user_logout', 'uses' => 'UserController@get_logout'));
Route::get('/registration', array('as' => 'user_registration', 'uses' => 'UserController@get_register'));
Route::post('/registration', array('as' => 'user_registration', 'uses' => 'UserController@post_register'));
Route::group(['middleware' => 'App\\Http\\Middleware\\Authenticate'], function () {
    Route::get('admin', array('as' => 'admin', 'uses' => 'AdminController@get_index'));
    //Users
    Route::get('admin/users', array('as' => 'user_index', 'uses' => 'UserController@get_index'));
    Route::get('admin/user/new', array('as' => 'new_user', 'uses' => 'UserController@get_new'));
    Route::get('admin/user/{id}/edit', array('as' => 'edit_user', 'uses' => 'UserController@edit_user'));
    Route::post('admin/user/create', array('as' => 'create_user', 'uses' => 'UserController@post_user'));
    Route::post('admin/user/update', array('as' => 'update_user', 'uses' => 'UserController@update_user'));
Exemplo n.º 2
0
 /**
  *Handle get request to '/analysis'
  *
  * @return \Illuminate\Http\Response
  */
 public function analysis()
 {
     $components = Component::all('component', 'component_id');
     $states = State::all('state', 'state_id');
     return view('analysis', compact('states', 'components'));
 }