• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP app\Setting类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app\Setting的典型用法代码示例。如果您正苦于以下问题:PHP Setting类的具体用法?PHP Setting怎么用?PHP Setting使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Setting类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: patchSettings

 /**
  * 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'));
 }
开发者ID:abada,项目名称:laravel-5-simple-cms,代码行数:14,代码来源:SettingController.php


示例2: update

 /**
  * 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'));
 }
开发者ID:Vatia13,项目名称:gbtimes,代码行数:14,代码来源:SettingsController.php


示例3: update

 /**
  * 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.";
 }
开发者ID:nveeed,项目名称:Laravel-Social-App,代码行数:17,代码来源:SettingsController.php


示例4: saveSettings

 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');
 }
开发者ID:andremiguelaa,项目名称:liga-quiz,代码行数:12,代码来源:AdminController.php


示例5: store

 /**
  * 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;
 }
开发者ID:sordev,项目名称:bootup,代码行数:37,代码来源:UserController.php


示例6: update

 /**
  * 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');
 }
开发者ID:realnerdo,项目名称:blog,代码行数:14,代码来源:SettingsController.php


示例7: boot

 /**
  * 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]);
     }
 }
开发者ID:labkod,项目名称:real-estate,代码行数:12,代码来源:AppServiceProvider.php


示例8: boot

 /**
  * 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);
 }
开发者ID:abada,项目名称:laravel-5-simple-cms,代码行数:40,代码来源:RouteServiceProvider.php


示例9: setting

/**
 * 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();
}
开发者ID:angelWendy,项目名称:streamlet,代码行数:13,代码来源:helpers.php


示例10: show

 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]);
 }
开发者ID:gitstashgithub,项目名称:rating,代码行数:25,代码来源:LessonController.php


示例11: run

 /**
  * 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]]);
 }
开发者ID:syntropysoftware,项目名称:cryptoffice-frontend,代码行数:12,代码来源:DatabaseSeeder.php


示例12: run

 /**
  * 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']);
 }
开发者ID:borislemke,项目名称:kbr,代码行数:12,代码来源:SettingsTableSeeder.php


示例13: postUpdate

 public function postUpdate($id)
 {
     $settingupdate = Request::all();
     $setting = Setting::find($id);
     $setting->update($settingupdate);
     return redirect('admin/settings/')->with('flash_message', 'Settings Save');
 }
开发者ID:alongmuaz,项目名称:laravel-fyp-cart,代码行数:7,代码来源:SettingController.php


示例14: balance_currency

 /**
  * Баланс пользователя в валюте пользователя
  * @return float
  */
 public function balance_currency()
 {
     $currency = $this->currency;
     $course = Setting::get($currency . '_course', 1);
     $balance = $this->balance / $course;
     return $balance;
 }
开发者ID:Eduard90,项目名称:Laravel-5-Example,代码行数:11,代码来源:User.php


示例15: setting

/**
* 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;
}
开发者ID:philippejadin,项目名称:Mobilizator,代码行数:11,代码来源:Functions.php


示例16: run

 /**
  * 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]);
 }
开发者ID:disik69,项目名称:backend.english-roulette-v0.3,代码行数:13,代码来源:SettingTableSeeder.php


示例17: boot

 /**
  * 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);
 }
开发者ID:udayc,项目名称:travel,代码行数:13,代码来源:AppServiceProvider.php


示例18: boot

 /**
  * 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'));
     });
 }
开发者ID:realnerdo,项目名称:blog,代码行数:13,代码来源:AppServiceProvider.php


示例19: getRegister

 /**
  * 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('/');
 }
开发者ID:realnerdo,项目名称:blog,代码行数:14,代码来源:AuthController.php


示例20: getDatabaseArgument

 function getDatabaseArgument($name, $key, $category = 'ViewArguments')
 {
     try {
         return Setting::getSettingByName($name, $category)->{$key};
     } catch (Exception $ex) {
         return '#ERROR';
     }
 }
开发者ID:gingzai,项目名称:Laravel-CMF,代码行数:8,代码来源:ViewController.php



注:本文中的app\Setting类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP app\Student类代码示例发布时间:2022-05-23
下一篇:
PHP app\Role类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap