# */ $photo = App\Photo::find(3); /* You Can Check ID [ 1,2,3,4 ] */ $imageable = $photo->imageable; return $imageable; }); Route::get('/many-to-many-polymorphic', function () { $posts = App\Post::find(1); // return $posts->tags; $vieos = App\Video::find(1); // return $vieos->tags; $tags = App\Tag::find(2); // return $tags->posts; foreach ($tags->posts as $post) { echo $post->pivot->tag_id; } // return $tags->videos; return 'Hello World'; }); Route::get('/review', function () { $doctors = App\Doctor::find(1); return $doctors->reviews; $institutes = App\Institute::find(1); // return $institutes->reviews; $user = App\User::find(1); // return $user->doctors; return $user->institutes; return 'Review'; });
Route::post('visit/create', 'VisitController@store'); Route::get('visit', 'VisitController@index'); Route::get('visit/{id}', 'VisitController@show'); Route::delete('visit/{id}', 'VisitController@discharge'); // //User controllers Route::get('user/home', 'UserController@index'); // /*Nurse Controller */ Route::get('nurse/home', 'AdminController@home'); // admin home //Doctor landing page Route::get('doctor/home', 'DoctorController@home'); // admin home // Authentication routes... Route::get('auth/login', 'Auth\\AuthController@getLogin'); 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'); // password route Route::controllers(['password' => 'Auth\\PasswordController']); //ajax request Route::get('/getdoctors', function () { $doc_id = Input::get('doc_id'); $doctors = App\Doctor::where('field', '=', $doc_id)->get(); return Response::json($doctors); }); //dummy routes Route::get('dummy', 'PisController@test');
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) { return App\Timeslot::whereId($id)->first(); }); Route::resource('timeslot', 'TimeslotController'); Route::get('{lead_id}/retrieve_notes', ['as' => 'retrieve_notes_by_lead', 'uses' => 'NoteController@retrieveNote']);