/** * Update the settings in storage. * * @param Setting $setting * @param SettingRequest $request * @return Response */ public function patchSettings(Setting $setting, SettingRequest $request) { $data = $this->storeImage($request, 'logo'); $setting->fill($data); $setting->save() == true ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail')); return redirect(route('admin.setting.index')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $load * @return \Illuminate\Http\Response */ public function update(Request $request, Setting $setting) { Cache::forget('settings'); $setting->updateSettings($request, ['site_title', 'site_tags', 'site_description', 'allow_registration', 'pagination_num']); flash()->success(trans('all.entry_updated')); return redirect(action('Admin\\SettingsController@index')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, Setting $setting) { $this->validate($request, ['who_can_see_my_skills' => 'required|in:' . join(",", Setting::$options), 'who_can_see_who_i_am_following' => 'required|in:' . join(",", Setting::$options)]); \ChromePhp::log($setting->getTable()); $this->authorize('owns', $setting); $setting->who_can_see_my_skills = $request->who_can_see_my_skills; $setting->who_can_see_who_i_am_following = $request->who_can_see_who_i_am_following; $setting->save(); return "Settings updated."; }
public function saveSettings(Request $request) { $input = $request->all(); $notification = Setting::where('name', 'notification')->first(); if (!count($notification)) { $notification = new Setting(); $notification->name = 'notification'; } $notification->value = $input['notification']; $notification->save(); return redirect()->route('admin'); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request) { $v = Validator::make($request->all(), ['username' => 'required|unique:users|alpha_num', 'email' => 'required|unique:users|email', 'emailConfirmation' => 'required|same:email', 'password' => 'required', 'passwordConfirmation' => 'required|same:password', 'tos' => 'required']); //recaptcha implementation $recaptcha = new \ReCaptcha\ReCaptcha(Setting::getSetting('recaptchasecret')); $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); //dd($resp); if ($v->fails() || $resp->isSuccess() == false) { if ($resp->isSuccess() == false) { $v->errors()->add('g-recaptcha', 'Би машин биш гэсэн чагтыг тэмдэглэнэ үү'); } $errors = $v->errors(); $return['status'] = false; $return['errors'] = $errors; //return redirect('/user/register')->back()->withErrors($v->errors())->withInput($request->except('password')); } else { $user = new User(); $user->email = $request->input('email'); $user->password = Hash::make($request->input('password')); $user->register_ip = $_SERVER['REMOTE_ADDR']; $user->registered_with = 'local'; $user->public = 0; $user->status = 1; $user->role = 2; $user->save(); $this->sendThankYouEmail($user); Auth::login($user, true); $return['status'] = true; $return['url'] = url('/user/profile/' . $user->usr_id); } return $return; }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(SettingRequest $request, $id) { $setting = Setting::findOrFail($id); $setting->update($request->all()); session()->flash('flash_message', 'Se han actualizado los datos del Blog'); return redirect('admin/settings?tab=blog'); }
/** * Bootstrap any application services. * * @return void */ public function boot() { foreach (Setting::all() as $setting) { $exp = explode("_", $setting->name); config([$exp[0] . "." . $exp[1] => $setting->value]); } }
/** * Define your route model bindings, pattern filters, etc. * * @param \Illuminate\Routing\Router $router * @return void */ public function boot(Router $router) { // bind article $router->model('article', 'App\\Article'); $router->bind('admin.article', function ($id) { return \App\Article::findOrFail($id); }); // bind category $router->model('category', 'App\\Category'); $router->bind('admin.category', function ($id) { return \App\Category::findOrFail($id); }); // bind language $router->model('language', 'App\\Language'); $router->bind('admin.language', function ($id) { return \App\Language::findOrFail($id); }); // bind language $router->model('page', 'App\\Page'); $router->bind('admin.page', function ($id) { return \App\Page::findOrFail($id); }); // bind setting $router->model('setting', 'App\\Setting'); $router->bind('admin.setting', function ($id) { return \App\Setting::findOrFail($id); }); // bind user $router->model('user', 'App\\User'); $router->bind('admin.user', function ($id) { return \App\User::findOrFail($id); }); parent::boot($router); }
/** * Get setting * * @param $name * @return mixed */ function setting($name) { $settings = Cache::rememberForever('settings', function () { return Setting::select('name', 'value')->get(); }); return $settings->where('name', $name)->first(); }
public function show($id) { $lesson = Lesson::find($id); $ratings = []; if (!$lesson) { return response('Leeson not found', 404); } if ($lesson->enabled) { $length = 90; //minute $now = new Carbon(); if ($lesson->updated_at->diffInMinutes($now) > $length) { $lesson->enabled = 0; $lesson->save(); } } else { $ratings = Rating::withTrashed()->where('lesson_id', '=', $id)->get()->all(); } $bookmarks = $lesson->bookmarks->sortBy('bookmarked_at'); foreach ($bookmarks as $bookmark) { $bookmark->bookmarked_at = new Carbon($bookmark->bookmarked_at); } $settings = Setting::all(); return response()->view('lesson.show', ['lesson' => $lesson, 'ratings' => $ratings, 'bookmarks' => $bookmarks, 'settings' => $settings]); }
/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); Label::create(['name' => 'favorite']); Label::create(['name' => 'trashed']); Setting::insert([['name' => 'homeTagline', 'value' => 'Syntropy Cloud, Your Cloud Your Way'], ['name' => 'homeByline', 'value' => 'Register or Login now to upload, backup, manage and access your files on any device, from anywhere, free.'], ['name' => 'homeButtonText', 'value' => 'Register Now'], ['name' => 'homepage', 'value' => 'landing'], ['name' => 'blacklist', 'value' => 'exe, application/x-msdownload, x-dosexec'], ['name' => 'maxFileSize', 'value' => 20], ['name' => 'maxUserSpace', 'value' => 104857600], ['name' => 'enableRegistration', 'value' => 1], ['name' => 'siteName', 'value' => 'CryptOffice'], ['name' => 'enableHomeUpload', 'value' => 1], ['name' => 'maxSimultUploads', 'value' => 10], ['name' => 'enablePushState', 'value' => 0], ['name' => 'dateLocale', 'value' => 'en'], ['name' => 'pushStateRootUrl', 'value' => '/'], ['name' => 'disqusShortname', 'value' => 'cryptoffice'], ['name' => 'enablePayments', 'value' => 1]]); }
/** * Run the database seeds. * * @return void */ public function run() { // \App\Setting::create(['name' => 'title', 'value' => 'Kibarer']); \App\Setting::create(['name' => 'description', 'value' => 'Property Agency']); \App\Setting::create(['name' => 'keyword', 'value' => 'kibarer, property agency, villa for sale, villa for rent, lands for sale, lands for rent']); }
public function postUpdate($id) { $settingupdate = Request::all(); $setting = Setting::find($id); $setting->update($settingupdate); return redirect('admin/settings/')->with('flash_message', 'Settings Save'); }
/** * Баланс пользователя в валюте пользователя * @return float */ public function balance_currency() { $currency = $this->currency; $course = Setting::get($currency . '_course', 1); $balance = $this->balance / $course; return $balance; }
/** * returns the value of $name setting as stored in DB // TODO refactor */ function setting($name, $default = false) { $setting = \App\Setting::where('name', $name)->first(); if ($setting) { return $setting->value; } return $default; }
/** * Run the database seeds. * * @return void */ public function run() { \DB::table('settings')->delete(); Setting::create(['key' => 'reading_count', 'value' => 7]); Setting::create(['key' => 'memory_count', 'value' => 7]); Setting::create(['key' => 'repeat_term', 'value' => 7]); Setting::create(['key' => 'lesson_size', 'value' => 30]); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $settingsval = Setting::all(); foreach ($settingsval as $val) { $data[$val->config_key] = $val->config_value; } View::share('_settings_data', (object) $data); }
/** * 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')); }); }
/** * 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('/'); }
function getDatabaseArgument($name, $key, $category = 'ViewArguments') { try { return Setting::getSettingByName($name, $category)->{$key}; } catch (Exception $ex) { return '#ERROR'; } }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('settings', function (Blueprint $table) { $table->increments('id'); $table->string('data'); }); Setting::create(['data' => ['website_title' => 'Synergie', 'admin_title' => 'Synergie', 'admin_email' => '*****@*****.**', 'website_description' => 'description', 'code_footer' => '', 'code_header' => '']]); }
public function store(Request $request) { foreach (Input::except('_token') as $id => $value) { $setting = Setting::find($id); $setting->value = $value; $setting->save(); } return redirect()->route("settings.all")->with('setting-saved', 'Successful saved!'); }
public static function allSetting() { $settingobj = Setting::all(); $return = array(); foreach ($settingobj as $o) { $return[$o->name] = $o->value; } return $return; }
public function update(Request $request) { $settings = $request->except('_method', '_token'); foreach ($settings as $key => $value) { $set = Setting::find($key); $set->fill(['value' => $value])->save(); } return redirect('/setting')->with('success', 'Sukses memperbarui pengaturan'); }
/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if (\Auth::check()) { \View::share('user', \Auth::user()); } \View::share('title', Setting::get('title')); \View::share('main', 0); return $next($request); }
/** * Run the database seeds. * * @return void */ public function run() { Setting::create(['name' => 'registration_group', 'setting' => env('REGISTRATION_GROUP')]); Setting::create(['name' => 'registration_group_id', 'setting' => env('REGISTRATION_GROUP_ID')]); Setting::create(['name' => 'default_home_directory', 'setting' => env('DEFAULT_HOME_DIRECTORY')]); Setting::create(['name' => 'default_shell', 'setting' => env('DEFAULT_SHELL')]); Setting::create(['name' => 'db_manager_url', 'setting' => env('DB_MANAGER_URL')]); Setting::create(['name' => 'current_uid_number', 'setting' => env('INITIAL_UID_NUMBER')]); }
/** * Update settings from the edit form */ public function update(Request $request) { if (Auth::user()->isAdmin()) { \App\Setting::set('homepage_presentation', $request->input('homepage_presentation')); return redirect()->action('DashboardController@index'); } else { flash()->error(trans('messages.not_allowed')); return redirect()->action('DashboardController@index'); } }
/** * Run the database seeds. * * @return void */ public function run() { // Setting::firstOrCreate(['name' => 'is_installed', 'setting' => 'yes']); Setting::firstOrCreate(['name' => 'is_installed', 'setting' => 'no']); Setting::firstOrCreate(['name' => 'default_profile_picture', 'setting' => '/images/default_profile_image.png']); Setting::firstOrCreate(['name' => 'company_name', 'setting' => 'Genesis Events Ltd.']); Setting::firstOrCreate(['name' => 'description', 'setting' => 'We are an awesome company']); Setting::firstOrCreate(['name' => 'company_logo', 'setting' => '/images/logo_full.png']); Setting::firstOrCreate(['name' => 'company_logo_white', 'setting' => '/images/logo_full_white.png']); }
public function edit($locationID) { if (!Auth::check() || !Auth::user()->is_admin) { return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions_news']]), 403); } $item = Location::find($locationID); // If no featured image, put in our default image $item->featured_image = $item->featured_image == '' ? Setting::where('name', 'default_profile_picture')->first()->setting : $item->featured_image; return view('locations.edit')->with('item', $item); }
/** * Run the database seeds. * * @return void */ public function run() { // TODO: Implement run() method. DB::table("settings")->delete(); $menu = array(); array_push($menu, array(["name" => "Account Settings", "icon" => "mdi-accounts", "action" => ""])); array_push($menu, array(["name" => "System Settings", "icon" => "mdi-settings", "action" => ""])); array_push($menu, array(["name" => "Logout", "icon" => "mdi-accounts", "action" => ""])); Setting::create(["name" => "headermenu", "data" => json_encode($menu[0])]); }