當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Setting::find方法代碼示例

本文整理匯總了PHP中app\Setting::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Setting::find方法的具體用法?PHP Setting::find怎麽用?PHP Setting::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Setting的用法示例。


在下文中一共展示了Setting::find方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: store

 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!');
 }
開發者ID:gitstashgithub,項目名稱:rating,代碼行數:9,代碼來源:SettingController.php

示例3: update

 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');
 }
開發者ID:nugi,項目名稱:SI_Dinas,代碼行數:9,代碼來源:SettingController.php

示例4: update

 public function update($data)
 {
     $setting = null;
     if (isset($data['id'])) {
         $setting = Setting::find($data['id']);
         $setting->update($data);
     }
     return $setting;
 }
開發者ID:manogi,項目名稱:gfw-qm,代碼行數:9,代碼來源:EloquentSettingRepository.php

示例5: store

 public function store(SettingRequest $request)
 {
     //remove from cache old data to update global website settings
     Cache::forget('settings');
     $settings = Setting::find(1);
     //update database using json format
     $settings->data = ['website_title' => $request->get('website_title'), 'admin_title' => $request->get('admin_title'), 'website_description' => $request->get('website_description'), 'admin_email' => $request->get('admin_email'), 'code_header' => $request->get('code_header'), 'code_footer' => $request->get('code_footer')];
     $settings->update();
     flash('Settings updated with success');
     return redirect()->back();
 }
開發者ID:victorboissiere,項目名稱:Synergie,代碼行數:11,代碼來源:SettingsController.php

示例6: ajax_variable

 public function ajax_variable()
 {
     $data = Request::all();
     $s = Setting::find($data['pk']);
     // change name and value variable
     if ($data['name'] == 'name') {
         $s->name = $data['value'];
     } elseif ($data['name'] == 'value') {
         $s->value = $data['value'];
     } else {
         $s->lang_code = $data['lang_code'];
     }
     $s->save();
 }
開發者ID:namcoder,項目名稱:Topshare,代碼行數:14,代碼來源:SettingsController.php

示例7: getRefresh

 public function getRefresh(Request $req)
 {
     $Set1 = Setting::find(1);
     $Set2 = Setting::find(2);
     $Set1->sitename = $Set2->sitename;
     $Set1->description = $Set2->description;
     $Set1->email = $Set2->email;
     $Set1->tag = $Set2->tag;
     $Set1->fb = $Set2->fb;
     $Set1->twitter = $Set2->twitter;
     $Set1->gambar_utama = $Set2->gambar_utama;
     $Set1->save();
     $req->session()->flash('success', 'Berhasil mengembalikan pengaturan');
     return redirect(route('setting'));
 }
開發者ID:MediaSaktiTeam,項目名稱:MS_kelautan,代碼行數:15,代碼來源:SettingController.php

示例8: __construct

 public function __construct()
 {
     View::share('pros', Product::take(8)->Where('status', 1)->orderBy('created_at', 'DESC')->get());
     View::share('customs', Product::take(8)->Where('type', 0)->orderBy('created_at', 'DESC')->get());
     View::share('products', Product::take(8)->Where('status', 1)->orderBy('created_at', 'DESC')->get());
     View::share('cus', Product::take(8)->Where('status', 1)->orderBy('created_at', 'ASC')->get());
     View::share('categories', Category::all());
     View::share('cart_content', Cart::content());
     View::share('count', Cart::count());
     View::share('total', Cart::total());
     View::share('set', Setting::find(1));
     View::share('tos', Cart::tos());
     View::share('transactions', Transaction::orderBy('created_at', 'desc')->paginate(10));
     View::share('settings', Setting::find(1));
     View::share('caty', Category::take(5)->orderBy('created_at', 'DESC')->get());
     View::share('payments', Payment::Where('status', 1)->get());
     View::share('customers', Customer::all());
     View::share('orders', Order::all());
     View::share('cat', Category::all());
     View::share('db', Product::take(6)->Where('status', 1)->orderBy('created_at', 'ASC')->get());
 }
開發者ID:alongmuaz,項目名稱:laravel-fyp-cart,代碼行數:21,代碼來源:BaseController.php

示例9: store

 public function store(Request $request)
 {
     $this->validate($request, ['app_name' => 'required|max:100']);
     \DB::beginTransaction();
     try {
         $settings = Setting::find(1);
         if (!empty($settings)) {
             $settings->app_name = $request->app_name;
             $settings->update();
         } else {
             $settings = new Setting();
             $settings->app_name = $request->app_name;
             $settings->save();
         }
         \DB::commit();
         Session::flash('flash_message', 'Settings successfully updated!');
         return redirect()->back();
     } catch (Exception $e) {
         DB::rollBack();
         return redirect()->back();
     }
 }
開發者ID:renciebautista,項目名稱:sparepartsfinder,代碼行數:22,代碼來源:SettingsController.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $settings = Setting::find(1);
     $settings->uploader_email = $request->uploader_email;
     $settings->enable_ig_edit = $request->has('enable_ig_edit') ? 1 : 0;
     $settings->validate_posting_mkl = $request->has('validate_posting_mkl') ? 1 : 0;
     $settings->validate_printing_mkl = $request->has('validate_printing_mkl') ? 1 : 0;
     $settings->validate_posting_ass = $request->has('validate_posting_ass') ? 1 : 0;
     $settings->validate_printing_ass = $request->has('validate_printing_ass') ? 1 : 0;
     $settings->validate_reposting_mkl = $request->has('validate_reposting_mkl') ? 1 : 0;
     $settings->validate_reposting_ass = $request->has('validate_reposting_ass') ? 1 : 0;
     $settings->device_password = $request->device_password;
     $settings->update();
     $hash = UpdateHash::find(1);
     if (empty($hash)) {
         UpdateHash::create(['hash' => \Hash::make(date('Y-m-d H:i:s'))]);
     } else {
         $hash->hash = md5(date('Y-m-d H:i:s'));
         $hash->update();
     }
     Session::flash('flash_message', 'Settings successfully updated.');
     Session::flash('flash_class', 'alert-success');
     return redirect()->route("settings.index");
 }
開發者ID:renciebautista,項目名稱:pcount2,代碼行數:30,代碼來源:SettingsController.php

示例11: contact

 public function contact()
 {
     $data['setting'] = Setting::find(1);
     return view('front.contact.index', $data);
 }
開發者ID:MediaSaktiTeam,項目名稱:MS_kelautan,代碼行數:5,代碼來源:FrontController.php

示例12: saveSettings

 public function saveSettings(Request $request)
 {
     $settings = Setting::find(1);
     $settings->voteInterval = $request->input('voteInterval');
     $settings->save();
     return redirect('admin/settings')->with('status', 'Settings updated!');
 }
開發者ID:kazakevic,項目名稱:ArkTopList,代碼行數:7,代碼來源:AdminController.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $setting = Setting::find($id);
     $setting->delete();
     return redirect()->route('setting.index');
 }
開發者ID:lamadipen,項目名稱:tracker,代碼行數:13,代碼來源:SettingController.php

示例14: addVote

 public function addVote(Request $request)
 {
     $this->validate($request, ['g-recaptcha-response' => 'required|recaptcha']);
     $id = $request->input('server_id');
     $settings = Setting::find(1);
     $interval = $settings->voteInterval;
     $ip = getHostByName(php_uname('n'));
     //Check if user alredy voted in 24h
     $vote = Vote::where('ip', $ip)->first();
     if ($vote != null) {
         if ($vote->updated_at->addHours($interval) > Carbon::now()) {
             //already voted
             return redirect('server/' . $id)->withErrors('You have already voted. Now you can vote after ' . $interval . ' hours from your voting time');
         }
     }
     //Deletes old record
     Vote::where('ip', $ip)->delete();
     $server = serverModel::where('id', $id)->first();
     $votes = $server->votes;
     $server->votes = $votes + 1;
     $server->save();
     $vote = new Vote();
     $vote->ip = $ip;
     $vote->save();
     return redirect('server/' . $id)->with('status', 'You have successfully voted!');
 }
開發者ID:kazakevic,項目名稱:ArkTopList,代碼行數:26,代碼來源:ServerController.php

示例15: utime

 public function utime(Request $request)
 {
     //
     $id = 1;
     $setting = Setting::find($id);
     $setting->refresh_interval = $request->refresh_interval;
     if (intval($setting->refresh_interval) < 1) {
         $setting->refresh_interval = 1;
     }
     $setting->warn_timeout = $request->warn_timeout;
     $setting->save();
     echo 1;
 }
開發者ID:vilison,項目名稱:work-order,代碼行數:13,代碼來源:SettingController.php


注:本文中的app\Setting::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。