public function save(Request $request) { $title = $request->input('title'); $note = $request->input('note'); $pri = $request->input('priority'); $n = new \App\Note(); $n->title = $title; $n->note = $note; $n->priority = $pri; $n->save(); return $title . ' ' . $note . ' ' . $pri; }
return App\Category::whereSlug($slug)->first(); }); Route::bind('device', function ($slug) { 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
Route::post('/users/websites', 'UsersController@moreWebsites'); Route::post('/users/books/remove', 'UsersController@removeBook'); Route::post('/users/websites/remove', 'UsersController@removeWebsite'); // ArticlesController Route::post('articles/save_comment/{id}', 'ArticlesController@saveComment'); Route::delete('articles/{id}/delete', 'ArticlesController@destroy'); Route::resource('articles', 'ArticlesController'); // Authentication routes... Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); // Registration routes... Route::get('auth/register', 'Auth\\AuthController@getRegister'); Route::post('auth/register', 'Auth\\AuthController@postRegister'); Route::get('subjects/{id}/add_book', 'SubjectsController@add_book'); Route::get('subjects/{id}/add_person', 'SubjectsController@add_person'); Route::get('subjects/{id}/add_website', 'SubjectsController@add_website'); Route::post('subjects/{id}/save_book', 'SubjectsController@save_book'); Route::post('subjects/{id}/save_person', 'SubjectsController@save_person'); Route::post('subjects/{id}/save_website', 'SubjectsController@save_website'); Route::post('users/todos', function (Request $request) { \Auth::user()->notes()->create(['content' => $request->input('content')]); }); Route::post('users/todos/remove', function (Request $request) { $content = $request->input('content'); $note = App\Note::where('content', $content)->first(); $note->delete(); }); Route::post('/users/todos/all', function () { return \Auth::user()->notes; }); Route::get('/users/{id}', 'UsersController@view_profile');
<?php /* |-------------------------------------------------------------------------- | 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('/', function () { // return view('index'); //}); Route::get('/', 'NotesController@index'); Route::get('/register', 'NotesController@showRegister'); Route::get('/forgotpassword', 'NotesController@forgotPassword'); Route::post('/', 'NotesController@login'); Route::post('/register', 'NotesController@register'); Route::get('/notes', 'NotesController@showNotes'); Route::get('/logout', 'NotesController@logout'); Route::post('/notes', 'NotesController@saveNotes'); Route::get('/user/{id}/image', function ($id) { $note = App\Note::find($id); $response = Response::make($note->image, 200); $response->header('Content-Type', 'image/jpeg'); return $response; });
Route::get('doctor/{doctor}/locations', ['uses' => 'DoctorController@locations']); Route::bind('lead', function ($id) { return App\Lead::whereId($id)->first(); }); Route::resource('lead', 'LeadController'); Route::post('lead/update_information', ['as' => 'lead_update', 'uses' => 'LeadController@updateLeadInformation']); Route::bind('callback', function ($id) { return App\Callback::whereId($id)->first(); }); Route::resource('callback', 'CallbackController', ['only' => ['store', 'index', 'show', 'update']]); Route::bind('disposition', function ($id) { return App\Disposition::whereId($id)->first(); }); Route::resource('disposition', 'DispositionController', ['only' => ['store']]); Route::bind('note', function ($id) { return App\Note::whereId($id)->first(); }); Route::resource('note', 'NoteController', ['only' => 'store']); Route::bind('doctor', function ($id) { return App\Doctor::whereId($id)->first(); }); Route::resource('doctor', 'DoctorController'); Route::bind('user', function ($id) { return App\User::whereId($id)->first(); }); Route::resource('user', 'UserController'); Route::bind('location', function ($id) { return App\Location::whereId($id)->first(); }); Route::resource('location', 'LocationController'); Route::bind('timeslot', function ($id) {