title = $title; $this->fluff = $fluff === 'on' || $fluff === true; $this->data = $data; } /** * Get the view / contents that represents the component. * * @return \Illuminate\View\View */ public function render() { $context = [ 'baseURL' => url('/') ]; // Avoid generated routes if (Route::has(Route::currentRouteName())) { $context['route'] = Route::currentRouteName(); } if (Auth::check()) { /** @var \App\Models\User */ $user = Auth::user(); $context['session'] = [ 'id' => $user->id, 'heartbeat' => ($user->hasVerifiedEmail() || !config('app.email_verification')) && !$user->isBanned() ]; } if (!empty($this->data)) { $context['data'] = $this->data; } return view('layouts.app', compact('context')); } }