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


PHP Str::upper方法代码示例

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


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

示例1: uniqueReference

 /**
  * Generate unique reference
  *
  * @return string
  */
 public function uniqueReference()
 {
     do {
         $reference = Str::upper(Str::random($this->referenceLength()));
     } while (self::where($this->referenceField(), '=', $reference)->count() > 0);
     return $reference;
 }
开发者ID:sjousse,项目名称:laravel-unique-reference,代码行数:12,代码来源:UniqueReference.php

示例2: validate

    /**
     * Validates the Turkish Identity Number over HTTP connection to goverment sys
     * @param  array ['tcno' => string, 'isim' => string, 'soyisim' => string, 'dogumyili' => int]
     * @return bool
     */
    public static function validate($data = [])
    {
        if (!static::verify($data)) {
            return false;
        }
        if (count(array_diff(static::$validationfields, array_keys($data))) != 0) {
            return false;
        }
        foreach (static::$validationfields as $field) {
            $data[$field] = Str::upper($data[$field]);
        }
        $post_data = '<?xml version="1.0" encoding="utf-8"?>
		<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
			<soap:Body>
				<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
					<TCKimlikNo>' . $data['tcno'] . '</TCKimlikNo>
					<Ad>' . $data['isim'] . '</Ad>
					<Soyad>' . $data['soyisim'] . '</Soyad>
					<DogumYili>' . $data['dogumyili'] . '</DogumYili>
				</TCKimlikNoDogrula>
			</soap:Body>
		</soap:Envelope>';
        $ch = curl_init();
        // CURL options
        $options = array(CURLOPT_URL => 'https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $post_data, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_HEADER => false, CURLOPT_HTTPHEADER => array('POST /Service/KPSPublic.asmx HTTP/1.1', 'Host: tckimlik.nvi.gov.tr', 'Content-Type: text/xml; charset=utf-8', 'Content-Length: ' . strlen($post_data), 'SOAPAction: "http://tckimlik.nvi.gov.tr/WS/TCKimlikNoDogrula"'));
        curl_setopt_array($ch, $options);
        $response = curl_exec($ch);
        curl_close($ch);
        return strip_tags($response) === 'true' ? true : false;
    }
开发者ID:muratunal,项目名称:tckimlik,代码行数:35,代码来源:TcKimlik.php

示例3: update

 public function update(Request $request, $id)
 {
     $departamento = $request->input('departamento');
     if ($departamento != '0') {
         try {
             DB::beginTransaction();
             $usuario = User::find($id);
             $empleado = $usuario->empleado;
             $empleado->nombre = Str::upper($request->input('nombre'));
             $empleado->apellido_paterno = Str::upper($request->input('apellido_paterno'));
             $empleado->apellido_materno = Str::upper($request->input('apellido_materno'));
             $empleado->save();
             $usuario->username = Str::upper($request->input('username'));
             $usuario->password = bcrypt($request->input('password'));
             $usuario->rol_id = $request->input('departamento');
             $usuario->save();
             DB::commit();
             return redirect()->route('usuario.index');
         } catch (QueryException $e) {
             echo $e;
             DB::rollBack();
             return redirect()->route('usuario.edit', $id);
         }
     } else {
         return redirect()->route('usuario.edit', $id);
     }
 }
开发者ID:Chupolandia,项目名称:Syscofovet,代码行数:27,代码来源:UsuarioController.php

示例4: run

 public function run()
 {
     DB::table('facings')->truncate();
     $faker = Faker::create();
     foreach (range(1, 20) as $index) {
         Facing::create(['name' => Str::upper($faker->randomLetter), 'angle' => '5-25', 'is_obstructed' => $faker->boolean(50), 'contact_time' => '5-25', 'illumination_type' => '5-25', 'distance_from_road' => '5-25', 'billboard_proximity' => '50-100', 'billboard_id' => Billboard::find($faker->numberBetween(1, 20))->id]);
     }
 }
开发者ID:sagaciresearch,项目名称:adtracking,代码行数:8,代码来源:FacingTableSeeder.php

示例5: autocomplete

 public function autocomplete()
 {
     $term = Str::upper(Input::get('term'));
     $data = Cie::where('description', 'LIKE', '%' . $term . '%')->get();
     foreach ($data as $v) {
         $return_array[] = array('value' => $v->code, 'label' => $v->description);
     }
     return Response::json($return_array);
 }
开发者ID:rikardote,项目名称:agenda,代码行数:9,代码来源:CodigosController.php

示例6: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $empleado = Empleado::find($id);
     $empleado->nombre = Str::upper($request->input('nombre'));
     $empleado->apellido_paterno = Str::upper($request->input('apellido_paterno'));
     $empleado->apellido_materno = Str::upper($request->input('apellido_materno'));
     $empleado->save();
     return redirect()->route('surtidores');
 }
开发者ID:Chupolandia,项目名称:Syscofovet,代码行数:16,代码来源:SurtidorController.php

示例7: autocomplete

 public function autocomplete()
 {
     $term = Str::upper(Input::get('term'));
     $data = Colonia::where('colonia', 'LIKE', '%' . $term . '%')->get();
     foreach ($data as $v) {
         $return_array[] = array('value' => $v->id, 'label' => $v->zipcode . ' - ' . $v->colonia);
     }
     return Response::json($return_array);
 }
开发者ID:rikardote,项目名称:agenda,代码行数:9,代码来源:PacientesController.php

示例8: doReplacements

 protected function doReplacements($message, $attribute, $rule, $parameters)
 {
     $value = $attribute;
     $message = str_replace([':ATTRIBUTE', ':Attribute', ':attribute'], [Str::upper($value), Str::ucfirst($value), $value], $message);
     if (isset($this->replacers[Str::snake($rule)])) {
         $message = $this->callReplacer($message, $attribute, Str::snake($rule), $parameters);
     } elseif (method_exists($this, $replacer = "replace{$rule}")) {
         $message = $this->{$replacer}($message, $attribute, $rule, $parameters);
     }
     return $message;
 }
开发者ID:bsapaka,项目名称:eloquent-scalable-taxonomy,代码行数:11,代码来源:Validator.php

示例9: find

 /**
  * Find a handler for manage a request
  *
  * @param  string $method
  * @param  string $path
  * @return null|callable
  */
 public function find($method, $path)
 {
     $method = Str::upper($method);
     $handlers = $this->handlers[$method];
     if (Arr::exists($handlers, $path)) {
         return $handlers[$path];
     }
     foreach ($handlers as $regexPath => $handler) {
         if (preg_match('@^' . $regexPath . '$@', $path)) {
             return $handler;
         }
     }
 }
开发者ID:loduis,项目名称:alegra-php,代码行数:20,代码来源:CallableHandle.php

示例10: __callStatic

 public static function __callStatic($name, $attributes)
 {
     if (Str::startsWith('get', $name)) {
         $method = Str::camel($name);
         if (method_exists(new static(), $method)) {
             $class = static::class;
             if (Arr::exists($attributes, 0)) {
                 return $class::$method($attributes[0]);
             }
             return $class::$method();
         }
     }
     return env(Str::upper(Str::snake(Str::substr($name, 3))));
 }
开发者ID:garrinar,项目名称:laravel,代码行数:14,代码来源:Env.php

示例11: create

 public function create(Input $input)
 {
     $promotions = $input->get('promotion');
     if ($promotions != []) {
         foreach ($promotions as $n => $promotion) {
             $dpt = new Promotion();
             $dpt->firstOrCreate(['nom' => Str::upper($promotion)]);
         }
         Session::flash('flash_success', 'Vos promotions ont bien été créées');
     } else {
         Session::flash('flash_error', 'Aucun champs n\'a été envoyé');
     }
     $promotions = $this->promotion->all();
     return redirect(route('admin_promotion_get', compact('promotions')));
 }
开发者ID:Anassdev,项目名称:AdopteUnStage,代码行数:15,代码来源:PromotionEcoleController.php

示例12: selfUpperCase

 /**
  * Set attributes to upper case automatically
  */
 public function selfUpperCase()
 {
     if (is_array($this->attributes)) {
         foreach ($this->attributes as $field => $value) {
             if (is_string($value)) {
                 if (property_exists($this, 'guardedCase')) {
                     if (!in_array($field, $this->guardedCase)) {
                         $this->{$field} = Str::upper($value);
                     }
                 } else {
                     $this->{$field} = Str::upper($value);
                 }
             }
         }
     }
 }
开发者ID:baconfy,项目名称:eloquent-case,代码行数:19,代码来源:TransformUpperCase.php

示例13: load

 /**
  * Loads a locale.
  *
  * @param string $country The domain
  * @param string $locale  A locale
  *
  * @throws NotFoundResourceException when the resource cannot be found
  * @throws InvalidResourceException  when the resource cannot be loaded
  *
  * @return array
  */
 public function load(string $country, string $locale) : array
 {
     $country = Str::upper($country);
     $filename = "{$this->path}/{$locale}/{$country}.php";
     try {
         $loaded = $this->files->getRequire($filename);
         if (!is_array($loaded)) {
             throw new InvalidResourceException();
         }
         return $loaded;
     } catch (FileNotFoundException $e) {
         throw new NotFoundResourceException("{$filename} not found.", 0, $e);
     } catch (\Throwable $e) {
         throw new InvalidResourceException("{$filename} has invalid resources.", 0, $e);
     }
 }
开发者ID:znck,项目名称:states,代码行数:27,代码来源:FileLoader.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     try {
         $unidad = $request->input('unidad');
         $placas = $request->input('placas');
         $marca = $request->input('marca');
         $modelo = $request->input('modelo');
         $anio = $request->input('anio');
         $cap_tanque = $request->input('cap_tanque');
         $rendimiento = $request->input('rendimiento');
         $peso = $request->input('peso');
         $serie = $request->input('serie');
         $propiedad = $request->input('propiedad');
         $observaciones = $request->input('observaciones');
         if ($propiedad != "0") {
             $vehiculo = new Vehiculo();
             $vehiculo->unidad = Str::upper($unidad);
             $vehiculo->placas = Str::upper($placas);
             $vehiculo->marca = Str::upper($marca);
             $vehiculo->modelo = Str::upper($modelo);
             $vehiculo->anio = $anio;
             $vehiculo->cap_tanque = $cap_tanque;
             $vehiculo->rendimiento = $rendimiento;
             $vehiculo->peso = $peso;
             $vehiculo->serie = Str::upper($serie);
             $vehiculo->propiedad = Str::upper($propiedad);
             $vehiculo->observaciones = Str::upper($observaciones);
             $vehiculo->save();
             return redirect()->route('vehiculos');
         } else {
             return redirect()->route('nuevovehiculo');
         }
     } catch (Exception $ex) {
         echo $ex;
     }
 }
开发者ID:Chupolandia,项目名称:Syscofovet,代码行数:42,代码来源:VehiculoController.php

示例15: getConstantName

 public function getConstantName($humanReadableName)
 {
     return 'XML_' . Str::upper(Str::snake($humanReadableName)) . '_NODE';
 }
开发者ID:efrane,项目名称:letterpress,代码行数:4,代码来源:DOMNodeType.php


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