/** * Get Registration form to create a new user * Only if there are not settings * * @return \Illuminate\Http\Response */ public function getRegister() { $setting = Setting::latest()->first(); if (is_null($setting)) { return view('auth.register'); } return redirect('/'); }
/** * Bootstrap any application services. * * @return void */ public function boot(Guard $auth) { view()->composer('partials.sidebar', function ($view) use($auth) { $setting = Setting::latest()->first(); $currentUser = $auth->user(); $view->with(compact('setting', 'currentUser')); }); }
/** * Show the form for editing the specified resource. * * @param Setting $setting * @return \Illuminate\Http\Response */ public function edit() { $setting = Setting::latest()->first(); $user = Auth::user(); return view('settings.index', compact('setting', 'user')); }