mivita/app/helpers.php
2020-05-06 15:43:53 +02:00

44 lines
No EOL
907 B
PHP

<?php
if (! function_exists('make_old_url')) {
function make_old_url($path)
{
return config('app.old_url').$path;
}
}
if (! function_exists('make_old_url')) {
function make_old_url($path)
{
return config('app.old_url').$path;
}
}
if (! function_exists('get_file_last_time')) {
function get_file_last_time($value)
{
if (file_exists($value)) {
return filemtime($value);
}
return date("Ymd-i", time());
}
}
if (! function_exists('get_user_attr')) {
function get_user_attr($key){
if ($user = Auth::user()) {
return $user->getSetting($key);
}
return null;
}
}
if (! function_exists('set_user_attr')) {
function set_user_attr($key, $value){
if ($user = Auth::user()) {
return $user->setSetting([$key => $value]);
}
return null;
}
}