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]); }
/** * Run the database seeds. * * @return void */ public function run() { $client_id = \p4\Client::where('name', '=', 'Roth Rugs')->pluck('id')->first(); DB::table('deliverables')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Logo', 'created_by' => 1, 'client_id' => $client_id, 'status' => 'Pending Approval', 'date_delivered' => Carbon\Carbon::now()->toDateTimeString(), 'attachment' => 'http://xtramilemedia.com/wp-content/uploads/2014/12/XMM_LOGO_web_center1-e1419371859936.png']); $client_id = \p4\Client::where('name', '=', 'Uptown Realty')->pluck('id')->first(); DB::table('deliverables')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Design Approval', 'created_by' => 1, 'client_id' => $client_id, 'status' => 'Pending Approval', 'date_delivered' => Carbon\Carbon::now()->toDateTimeString()]); $client_id = \p4\Client::where('name', '=', 'Uptown Realty')->pluck('id')->first(); DB::table('deliverables')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'name' => 'Contract', 'created_by' => 1, 'client_id' => $client_id, 'status' => 'Pending Approval', 'date_delivered' => Carbon\Carbon::now()->toDateTimeString(), 'url' => 'http://www.contract.com']); }
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'; } }
/** * Run the User table database seeds. * * @return void */ public function run() { $client_id = \p4\Client::where('name', '=', 'Roth Rugs')->pluck('id')->first(); $role_id = \p4\Role::where('name', '=', 'Agency')->pluck('id')->first(); DB::table('users')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), "name" => "Jill", "email" => "*****@*****.**", "password" => bcrypt("helloworld"), "client_id" => $client_id, "role_id" => $role_id]); $client_id = \p4\Client::where('name', '=', 'Uptown Realty')->pluck('id')->first(); $role_id = \p4\Role::where('name', '=', 'Client')->pluck('id')->first(); DB::table('users')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), "name" => "Jamal", "email" => "*****@*****.**", "password" => bcrypt("helloworld"), "client_id" => $client_id, "role_id" => $role_id]); $client_id = \p4\Client::where('name', '=', 'Uptown Realty')->pluck('id')->first(); $role_id = \p4\Role::where('name', '=', 'Agency')->pluck('id')->first(); DB::table('users')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), "name" => "Shaun", "email" => "*****@*****.**", "password" => bcrypt("helloworld"), "client_id" => $client_id, "admin" => "1", "role_id" => $role_id]); }
/** function to display client dashboard **/ public function getDashboard(Request $request) { $authuser = $request->user(); $deliverables = \p4\Deliverable::where('client_id', '=', $authuser->client_id)->get(); if ($authuser->client_id) { $client = \p4\Client::where('id', '=', $authuser->client_id)->first(); $clientname = $client->name; } else { $clientname = 'Agency'; } return view('dashboard.dashboard', ['deliverables' => $deliverables, 'authuser' => $authuser, 'clientname' => $clientname]); /** $user=$request->user(); $dashboard= new \p4\Libraries\Dashboard($user); $dashboard->displayDashboard(); **/ }