本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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]);
}
}
示例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);
}
示例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');
}
示例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);
}
示例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;
}
示例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;
}
}
}
示例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))));
}
示例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')));
}
示例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);
}
}
}
}
}
示例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);
}
}
示例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;
}
}
示例15: getConstantName
public function getConstantName($humanReadableName)
{
return 'XML_' . Str::upper(Str::snake($humanReadableName)) . '_NODE';
}