function getControlpanel() { $deliverables = \p4\Deliverable::where('client_id', '=', $authuser->client_id)->get(); $client = \p4\Client::where('id', '=', $authuser->client_id)->first(); $clientname = $client->name; return view('dashboard.dashboard', ['deliverables' => $deliverables, 'authuser' => $authuser, 'clientname' => $clientname]); }
public function _construct() { $this->{$authuser} = $request->user(); $this->{$deliverables} = \p4\Deliverable::where('client_id', '=', $authuser->client_id)->get(); if ($authuser->client_id) { $client = \p4\Client::where('id', '=', $authuser->client_id)->first(); $this->{$clientname} = $client->name; } else { $this->{$clientname} = 'Agency'; } }
public function deleteDeliverable(\Request $request) { $deliverable = \p4\Deliverable::find($request::get('deliverable_id')); $deliverable->delete(); \Session::flash('message', 'Your Deliverable Has Been Uploaded'); return redirect()->back()->with('message', 'Deliverable Deleted'); }