Exemple #1
0
// });
Route::get('/', function () {
    if (Auth::check()) {
        return View::make('index');
    } else {
        return Redirect::to('login');
    }
});
/* View the NDA */
Route::get('nda/{id}', function ($id) {
    $contract = Contract::findOrFail($id);
    return View::make('nda')->withContract($contract);
});
/* Mail the NDA to a user */
Route::post('nda/{id}/send', function ($id) {
    $contract = Contract::findOrFail($id);
    return Mail::send('nda', ['contract' => $contract], function ($message) {
        return $message->to(Input::get('email'))->subject('NDA contract');
    });
});
/* Get the environment of the application*/
Route::get('environment', function () {
    return App::environment();
});
/* Route for testing */
Route::any('test', function () {
    $repo = new Acme\Users\UserRepository();
    return $repo->test();
});
/*
 * Custom defined Routes
 /**
  * Display the specified resource.
  * GET /contracts/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     return Contract::findOrFail($id);
 }