style updates
This commit is contained in:
@@ -39,7 +39,7 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerMigrations(): void
|
||||
{
|
||||
$path = dirname(__DIR__).'/Database/Migrations';
|
||||
$path = dirname(__DIR__) . '/Database/Migrations';
|
||||
|
||||
if (is_dir($path)) {
|
||||
$this->loadMigrationsFrom($path);
|
||||
@@ -51,7 +51,7 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerHelpers(): void
|
||||
{
|
||||
foreach (glob(dirname(__DIR__).'/Helpers/*.php') ?: [] as $filename) {
|
||||
foreach (glob(dirname(__DIR__) . '/Helpers/*.php') ?: [] as $filename) {
|
||||
require_once $filename;
|
||||
}
|
||||
}
|
||||
@@ -61,14 +61,14 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
$commandPath = dirname(__DIR__).'/Console';
|
||||
$commandPath = dirname(__DIR__) . '/Console';
|
||||
|
||||
if (! is_dir($commandPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$commands = collect(File::allFiles($commandPath))
|
||||
->map(fn ($file): string => 'Modules\\'.$this->moduleName.'\\Console\\'.$file->getFilenameWithoutExtension())
|
||||
->map(fn ($file): string => 'Modules\\' . $this->moduleName . '\\Console\\' . $file->getFilenameWithoutExtension())
|
||||
->filter(fn (string $class): bool => class_exists($class))
|
||||
->values()
|
||||
->all();
|
||||
@@ -83,14 +83,14 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$sourcePath = dirname(__DIR__).'/Config/config.php';
|
||||
$sourcePath = dirname(__DIR__) . '/Config/config.php';
|
||||
|
||||
if (! is_file($sourcePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => config_path(ModuleInfo::nameLower().'.php'),
|
||||
$sourcePath => config_path(ModuleInfo::nameLower() . '.php'),
|
||||
], 'config');
|
||||
|
||||
$this->mergeConfigFrom($sourcePath, ModuleInfo::nameLower());
|
||||
@@ -101,8 +101,8 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__).'/Resources/views';
|
||||
$viewPath = resource_path('views/modules/' . ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__) . '/Resources/views';
|
||||
|
||||
if (! is_dir($sourcePath)) {
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => $viewPath,
|
||||
], ['views', ModuleInfo::nameLower().'-module-views']);
|
||||
], ['views', ModuleInfo::nameLower() . '-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), ModuleInfo::nameLower());
|
||||
}
|
||||
@@ -120,8 +120,8 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerTranslations(): void
|
||||
{
|
||||
$publishedPath = resource_path('lang/modules/'.ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__).'/Resources/lang';
|
||||
$publishedPath = resource_path('lang/modules/' . ModuleInfo::nameLower());
|
||||
$sourcePath = dirname(__DIR__) . '/Resources/lang';
|
||||
|
||||
if (is_dir($publishedPath)) {
|
||||
$this->loadTranslationsFrom($publishedPath, ModuleInfo::nameLower());
|
||||
@@ -144,8 +144,8 @@ class CountriesServiceProvider extends ServiceProvider
|
||||
$paths = [];
|
||||
|
||||
foreach (Config::get('view.paths', []) as $path) {
|
||||
if (is_dir($path.'/modules/'.ModuleInfo::nameLower())) {
|
||||
$paths[] = $path.'/modules/'.ModuleInfo::nameLower();
|
||||
if (is_dir($path . '/modules/' . ModuleInfo::nameLower())) {
|
||||
$paths[] = $path . '/modules/' . ModuleInfo::nameLower();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
$path = dirname(__DIR__).'/Routes/web.php';
|
||||
$path = dirname(__DIR__) . '/Routes/web.php';
|
||||
|
||||
if (is_file($path)) {
|
||||
Route::middleware(['web', 'auth'])->group($path);
|
||||
@@ -33,7 +33,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
$path = dirname(__DIR__).'/Routes/api.php';
|
||||
$path = dirname(__DIR__) . '/Routes/api.php';
|
||||
|
||||
if (is_file($path)) {
|
||||
Route::middleware(['api'])->prefix('api/v1')->group($path);
|
||||
|
||||
Reference in New Issue
Block a user