/** * Display a listing of the resource. * * @return Response */ public function index() { $opportunities = $this->opportunity->all(); return View::make('opportunities.index', compact('opportunities')); }
*/ Route::resource('locations', 'LocationsController'); /* |----------------------------------------------------------------------- | Opportunities |----------------------------------------------------------------------- */ Route::resource('opportunities', 'OpportunitiesController'); Route::post('/user/{id}/add', array('as' => 'skills.add', 'uses' => 'SkillsController@useradd')); Route::group(array('prefix' => 'v1'), function () { Route::get('skills', function () { $skills = Skill::all(); return Response::json($skills->toArray(), 201); }); Route::get('opportunities', function () { $opportunities = Opportunity::all(); return Response::json($opportunities->toArray(), 201); }); Route::get('skill-matches', function () { $skillmatches = Skill::with('opportunities')->with('users')->has('opportunities')->has('users')->get(); return Response::json($skillmatches->toArray(), 201); }); Route::get('opportunity-matches', function () { $opportunitymatches = Opportunity::with('location')->with('skills')->get(); return Response::json($opportunitymatches->toArray(), 201); }); Route::get('community-events', function () { $communityevents = Community_event::with('location')->get(); return Response::json($communityevents->toArray(), 201); }); });