mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 04:04:45 +02:00
Replace File
with Storage
on EditProfile (#1353)
This commit is contained in:
parent
da35703f75
commit
bc115af5fd
@ -39,8 +39,8 @@ use Filament\Support\Enums\MaxWidth;
|
|||||||
use Filament\Support\Exceptions\Halt;
|
use Filament\Support\Exceptions\Halt;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\File;
|
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
use Illuminate\Validation\Rules\Password;
|
use Illuminate\Validation\Rules\Password;
|
||||||
use Laravel\Socialite\Facades\Socialite;
|
use Laravel\Socialite\Facades\Socialite;
|
||||||
@ -383,15 +383,16 @@ class EditProfile extends BaseEditProfile
|
|||||||
'monospace' => 'monospace', //default
|
'monospace' => 'monospace', //default
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!File::exists(public_path('storage/fonts'))) {
|
if (!Storage::disk('public')->exists('storage/fonts')) {
|
||||||
File::makeDirectory(public_path('storage/fonts'));
|
Storage::disk('public')->makeDirectory('storage/fonts');
|
||||||
$this->fillForm();
|
$this->fillForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (File::allFiles(public_path('storage/fonts')) as $file) {
|
foreach (Storage::disk('public')->allFiles('storage/fonts') as $file) {
|
||||||
if ($file->getExtension() === 'ttf') {
|
$fileInfo = pathinfo($file);
|
||||||
$name = pathinfo($file->getFilename(), PATHINFO_FILENAME);
|
|
||||||
$fonts[$name] = $name;
|
if ($fileInfo['extension'] === 'ttf') {
|
||||||
|
$fonts[$fileInfo['filename']] = $fileInfo['filename'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user