mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update UserObserver
This commit is contained in:
parent
8de42c7862
commit
03cf26a09a
2 changed files with 3 additions and 13 deletions
|
@ -4,8 +4,7 @@ namespace App\Providers;
|
|||
|
||||
use App\Observers\UserObserver;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use Horizon;
|
||||
use Auth, Horizon, URL;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
@ -43,17 +42,8 @@ class AppServiceProvider extends ServiceProvider
|
|||
});
|
||||
|
||||
Blade::directive('prettySize', function ($expression) {
|
||||
$size = intval($expression);
|
||||
$precision = 0;
|
||||
$short = true;
|
||||
$units = $short ?
|
||||
['B', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] :
|
||||
['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
for ($i = 0; ($size / 1024) > 0.9; $i++, $size /= 1024) {
|
||||
}
|
||||
$res = round($size, $precision).$units[$i];
|
||||
|
||||
return "<?php echo '$res'; ?>";
|
||||
$size = \App\Util\Lexer\PrettyNumber::size($expression);
|
||||
return "<?php echo '$size'; ?>";
|
||||
});
|
||||
|
||||
Blade::directive('maxFileSize', function () {
|
||||
|
|
Loading…
Reference in a new issue