public function __construct(Request $request) { $timezone = 'UTC'; if (Auth::user()->company != null) { $timezone = ""; } //Auth::user()->company->timezone; if (Auth::check()) { Config::set('app.timezone', $timezone); $this->company_id = User::where('id', Auth::user()->id)->with(['company' => function ($query) { $query->select('companies.id'); }])->first()->company->pluck("id")->toArray(); } if ($request->get('noti')) { Notification::markAsRead($request->get('noti')); } }