Replace deprecated array and string helpers

Laravel recommends using the `Str` and `Arr` class methods directly instead of the respective helper functions. These helper functions are deprecated in Laravel 5.8 and removed in Laravel 6.
This commit is contained in:
Shift
2023-01-06 11:53:35 +00:00
parent 03623d493d
commit b02541ac64
28 changed files with 91 additions and 70 deletions

View File

@@ -1,5 +1,7 @@
<?php
use Illuminate\Support\Str;
function loging($context, $message, $level = 'error', $array = [])
{
\Log::$level($message.':-:-:-'.$context, $array);
@@ -30,14 +32,14 @@ function mime($type)
$type == 'image/gif' ||
// $type == "application/octet-stream" ||
$type == 'image/png' ||
starts_with($type, 'image')) {
Str::startsWith($type, 'image')) {
return 'image';
}
}
function removeUnderscore($string)
{
if (str_contains($string, '_') === true) {
if (Str::contains($string, '_') === true) {
$string = str_replace('_', ' ', $string);
}