|
|
@ -199,7 +199,7 @@ function sortSuffix($col): string
|
|
|
|
* @param $translate
|
|
|
|
* @param $translate
|
|
|
|
* @return false|string
|
|
|
|
* @return false|string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function arrayNormolizeVueCompatible($array, $translate = false): false|string
|
|
|
|
function arrayNormalizeVueCompatible($array, $translate = false): false|string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$result = [];
|
|
|
|
$result = [];
|
|
|
|
foreach ($array as $index => $item) {
|
|
|
|
foreach ($array as $index => $item) {
|
|
|
@ -264,7 +264,7 @@ function gfx()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* build query with excepts
|
|
|
|
* http build query with excepts
|
|
|
|
* @param $except
|
|
|
|
* @param $except
|
|
|
|
* @return string
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -963,9 +963,9 @@ function success($data = null, $message = null, $meta = [], $og = [], $twitter =
|
|
|
|
$defaultOg = [
|
|
|
|
$defaultOg = [
|
|
|
|
'url' => null,
|
|
|
|
'url' => null,
|
|
|
|
'type' => null,
|
|
|
|
'type' => null,
|
|
|
|
'site_name' => env('APP_NAME'),
|
|
|
|
'site_name' => config('app.name'),
|
|
|
|
'description' => null,
|
|
|
|
'description' => null,
|
|
|
|
'locate' => 'fa_IR'
|
|
|
|
'locate' => config('app.locale')
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
$defaultTwitter = [
|
|
|
|
$defaultTwitter = [
|
|
|
@ -977,7 +977,7 @@ function success($data = null, $message = null, $meta = [], $og = [], $twitter =
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
return response()->json([
|
|
|
|
return response()->json([
|
|
|
|
"success" => true,
|
|
|
|
"OK" => true,
|
|
|
|
"message" => $message,
|
|
|
|
"message" => $message,
|
|
|
|
"data" => $data,
|
|
|
|
"data" => $data,
|
|
|
|
"meta" => array_merge($defaultMeta, $meta),
|
|
|
|
"meta" => array_merge($defaultMeta, $meta),
|
|
|
@ -997,7 +997,7 @@ function success($data = null, $message = null, $meta = [], $og = [], $twitter =
|
|
|
|
function errors($errors, $status = 422, $message = null, $data = null)
|
|
|
|
function errors($errors, $status = 422, $message = null, $data = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return response()->json([
|
|
|
|
return response()->json([
|
|
|
|
"success" => false,
|
|
|
|
"OK" => false,
|
|
|
|
"errors" => $errors,
|
|
|
|
"errors" => $errors,
|
|
|
|
"message" => $message,
|
|
|
|
"message" => $message,
|
|
|
|
"data" => $data,
|
|
|
|
"data" => $data,
|
|
|
@ -1011,7 +1011,7 @@ function errors($errors, $status = 422, $message = null, $data = null)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function readable($text)
|
|
|
|
function readable($text)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return ucfirst(trim(str_replace(['-', '_'], ' ', $text)));
|
|
|
|
return ucfirst(trim(str_replace(['-', '_','.'], ' ', $text)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1113,7 +1113,12 @@ function tagUrl($slug)
|
|
|
|
return fixUrlLang(route('client.tag', $slug));
|
|
|
|
return fixUrlLang(route('client.tag', $slug));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function usableProp($props)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param $props
|
|
|
|
|
|
|
|
* @return array
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function usableProp($props): array
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$result = [];
|
|
|
|
$result = [];
|
|
|
|
|
|
|
|
|
|
|
|