/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $resources = Resource::get(); $heading = 'Manage User Resources'; return view($this->view_all, array('resources' => $resources, 'heading' => $heading)); }
/** * Show form to manage resource for a plan * * @return \Illuminate\Http\Response */ public function index(Request $request, $plan_id) { // get current plan with resources $plan = Plan::with('resources')->find($plan_id); // get FULL list of resources $resources = Resource::get(); // return view if ($plan) { return view('cspot.resources', ['plan' => $plan, 'resources' => $resources]); } flashError('Plan with ID "' . $id . '" not found'); return redirect()->back(); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // find a single resource by ID $type = Type::find($id); if ($type) { // get the resources table $resources = Resource::get(); // also get the users table $users = User::orderBy('first_name')->get(); // return the view with all the data return view('admin.type', ['type' => $type, 'users' => $users, 'resources' => $resources]); } // $message = 'Error! Type with id "' . $id . '" not found'; return \Redirect::route('types.index')->with(['status' => $message]); }