mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-22 09:32:14 +00:00
src folder refactoring
This commit is contained in:
53
src/App/Providers/AppServiceProvider.php
Normal file
53
src/App/Providers/AppServiceProvider.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
try {
|
||||
$app_locale = get_setting('language') ?? 'en';
|
||||
} catch (\PDOException $exception) {
|
||||
$app_locale = 'en';
|
||||
}
|
||||
|
||||
// Set locale for application
|
||||
app()->setLocale($app_locale);
|
||||
|
||||
// Set locale for carbon dates
|
||||
setlocale(LC_TIME, $app_locale . '_' . mb_strtoupper($app_locale));
|
||||
|
||||
// Get all migrations with all directories
|
||||
$this->loadMigrationsFrom(
|
||||
$this->get_migration_paths()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function get_migration_paths(): array
|
||||
{
|
||||
$mainPath = database_path('migrations');
|
||||
$directories = glob($mainPath . '/*', GLOB_ONLYDIR);
|
||||
|
||||
return array_merge([$mainPath], $directories);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user