当前位置: 首页>>代码示例>>PHP>>正文


PHP Option::where方法代码示例

本文整理汇总了PHP中Option::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Option::where方法的具体用法?PHP Option::where怎么用?PHP Option::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Option的用法示例。


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

示例1: update

 /**
  * Update the specified resource in storage.
  * PUT /exp/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (Input::get('password') != 'admin8888') {
         return Redirect::route('exp.index');
     }
     $option = Option::where('key', '=', 'exp')->first();
     $option->value = date(Input::get('value'));
     $option->save();
     return Redirect::route('home');
 }
开发者ID:anthon-alindada,项目名称:gaming-88,代码行数:17,代码来源:ExpController.php

示例2: get

 public static function get($varname, $defvalue = null)
 {
     $opt = Option::where('varname', $varname)->first();
     if ($opt) {
         return $opt->value;
     } else {
         return is_null($value) ? '' : $defvalue;
         //return specified default value
     }
 }
开发者ID:awidarto,项目名称:tmadminflat,代码行数:10,代码来源:Options.php

示例3: set

 /**
  * Set an option
  * @param  string $key, string $value
  * @return boolean
  */
 public static function set($key, $value)
 {
     if (self::has($key)) {
         $option = Option::where('key', '=', $key)->first();
         if (!empty($option)) {
             $option->value = $value;
             if ($option->save()) {
                 Cache::forget('options');
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:Metrakit,项目名称:dynamix,代码行数:19,代码来源:Option.php

示例4: credits2euro

 static function credits2euro($credits = 0, $comma = true)
 {
     $dinero = (double) Option::where('option_key', 'credit_euro_' . $credits)->pluck('option_value');
     if (!$dinero) {
         $dinero = (double) Option::where('option_key', 'credit_euro')->pluck('option_value');
     }
     $formateado = sprintf("%01.2f", $dinero * $credits);
     //$formateado = round(sprintf("%01.2f", $dinero * $credits),2);
     if ($comma) {
         $formateado = str_replace(".", ",", $formateado);
     }
     return $formateado;
 }
开发者ID:BobbyBrights,项目名称:social,代码行数:13,代码来源:Str.php

示例5: encryption

 /**
  * post encryption
  *
  * @return string
  */
 public static function encryption()
 {
     $encryption = Option::where('option_name', '=', 'encryption')->first();
     $encryptvalue = $encryption->option_value;
     return $encryptvalue;
 }
开发者ID:MehmetNuri,项目名称:faveo-helpdesk,代码行数:11,代码来源:EmailController.php

示例6: postConfigSave

 public function postConfigSave()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $data = array("name" => Input::get("name"), "insurance" => Input::get("insurance"), "lang" => Input::get("lang"), "picture" => Input::file("picture"), "phone" => Input::get("phone"));
     $rules = array("name" => 'required|min:1|max:255', "insurance" => 'required|min:1|max:255', "lang" => 'required|min:1|max:10', "picture" => 'mimes:jpeg,gif,png', "phone" => 'required|numeric|min:1');
     $messages = array('required' => 'El campo :attribute es obligatorio.', 'min' => 'El campo :attribute no puede tener menos de :min carácteres.', 'email' => 'El campo :attribute debe ser un email válido.', 'max' => 'El campo :attribute no puede tener más de :max carácteres.', 'numeric' => 'El campo :attribute debe contener solo numeros', 'mimes' => 'El formato de la imagen :attribute debe ser jpg, git, png');
     $validation = Validator::make(Input::all(), $rules, $messages);
     //si la validación falla redirigimos al formulario de registro con los errores
     //y con los campos que nos habia llenado el usuario
     if ($validation->fails()) {
         return Redirect::to('/clinic/config-data/')->withErrors($validation)->withInput();
     } else {
         $id = Input::get("id");
         $clinic = Clinic::find($id);
         $clinic->name = Input::get("name");
         $clinic->phone = Input::get("phone");
         $clinic->insurances = Input::get("insurance");
         if (Input::file('picture') != NULL) {
             //agrega imagen de logo
             $file_logo = Input::file('picture');
             $ext = Input::file('picture')->getClientOriginalExtension();
             $nameIMG = date('YmdHis');
             $logo = $nameIMG . '.' . $ext;
             $logo = 'assets/clinic/images/logo/logo_' . $logo;
             $file_logo->move("assets/clinic/images/logo/", $logo);
             $clinic->picture = $logo;
         }
         $clinic->save();
         $adress = Address::find($clinic->address_id);
         $adress->my_address = Input::get("address");
         $adress->save();
         $lang = Option::where('name', $clinic->id . '-clinic-lang')->first();
         if ($lang) {
             $lang->key = Input::get("lang");
             $lang->save();
         } else {
             $langadd = new Option();
             $langadd->key = Input::get("lang");
             $langadd->name = $clinic->id . '-clinic-lang';
             $langadd->save();
         }
         return Redirect::back();
     }
 }
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:46,代码来源:ClinicController.php

示例7: delete_tag

 public function delete_tag()
 {
     $id = Request::segment(4);
     $tag = Option::find($id);
     Option::where('id', $id)->delete();
     $message = "Successfully deleted the product tag";
     $type = "success";
     return Redirect::to('/admin/tags')->with('type', $type)->with('message', $message);
 }
开发者ID:sohelrana820,项目名称:mario-gomez,代码行数:9,代码来源:AdminController.php

示例8: function

| cross-site request forgery attacks. If this special token in a user
| session does not match the one given in this request, we'll bail.
|
*/
Route::filter('csrf', function () {
    if (Session::token() !== Input::get('_token')) {
        throw new Illuminate\Session\TokenMismatchException();
    }
});
/*
|--------------------------------------------------------------------------
| EXP Protection Filter
|--------------------------------------------------------------------------
*/
Route::filter('exp', function () {
    $option = Option::where('key', '=', 'exp')->first();
    $exp = date($option->value);
    $now = date('Y-m-d 08:i:s');
    if (strtotime($now) > strtotime($exp)) {
        return '';
    }
});
/*
|--------------------------------------------------------------------------
| Admin Filter
|--------------------------------------------------------------------------
*/
Route::filter('admin', function () {
    if (Auth::user()->id != 1 && Auth::user()->id != 2) {
        return '';
    }
开发者ID:anthon-alindada,项目名称:gaming-88,代码行数:31,代码来源:filters.php

示例9: getConfigSave

 public function getConfigSave()
 {
     if (Payment::VeryPayment() == false) {
         return View::make('clinic.payment.renews-payment');
     }
     $data = array("insurance" => Input::get("insurance"), "lang" => Input::get("lang"));
     $rules = array("insurance" => 'required|min:1|max:100', "lang" => 'required|min:1|max:100');
     $messages = array('required' => 'El campo :attribute es obligatorio.', 'min' => 'El campo :attribute no puede tener menos de :min carácteres.', 'email' => 'El campo :attribute debe ser un email válido.', 'max' => 'El campo :attribute no puede tener más de :max carácteres.', 'numeric' => 'El campo :attribute debe contener solo numeros', 'mimes' => 'El formato de la imagen logo debe ser jpg, git, png');
     $validation = Validator::make(Input::all(), $rules, $messages);
     //si la validación falla redirigimos al formulario de registro con los errores
     //y con los campos que nos habia llenado el usuario
     if ($validation->fails()) {
         return Redirect::to('/clinic/config-data/')->withErrors($validation)->withInput();
     } else {
         $id = Doctor::doctorLogin();
         $doctor = Doctor::where('id', $id)->first();
         $lang = Option::where('name', $id . '-doctor-lang')->first();
         if ($lang) {
             $lang->key = Input::get("lang");
             $lang->save();
         } else {
             $langadd = new Option();
             $langadd->key = Input::get("lang");
             $langadd->name = $id . '-doctor-lang';
             $langadd->save();
         }
         $opcionSeg = Option::where('name', $id . '-doctor-insurance')->first();
         if ($opcionSeg) {
             $segs = explode(',', Input::get("insurance"));
             $segok = '';
             foreach ($segs as $seg) {
                 $very = Insurance::where('name', 'like', '%' . $seg . '%')->first();
                 if ($very) {
                     $segok = $segok . ',' . $seg;
                 }
             }
             $opcionSeg->key = $segok;
             $opcionSeg->save();
         } else {
             $segs = explode(',', Input::get("insurance"));
             $seguok = '';
             foreach ($segs as $seg) {
                 $very = Insurance::where('name', $seg)->first();
                 if ($very) {
                     $seguok = $seguok . ',' . $seg;
                 }
             }
             $addseg = new Option();
             $addseg->name = $id . '-doctor-insurance';
             $addseg->key = $seguok;
             $addseg->save();
         }
         return Redirect::back();
     }
 }
开发者ID:jnicolasbc,项目名称:admin_swp_com,代码行数:55,代码来源:DoctorController.php


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