From 1d6308a92972f63b14c2e179ba2f53862bde7326 Mon Sep 17 00:00:00 2001 From: GeorgeFourkas Date: Sat, 22 Jun 2024 19:47:22 +0000 Subject: [PATCH] Fix styling --- src/Adminify.php | 4 +- src/Commands/InstallationCommand.php | 221 +++++++++--------- stubs/app/Mail/ContactMail.php | 3 +- stubs/app/Rules/InPublishedLanguagesArray.php | 5 +- 4 files changed, 111 insertions(+), 122 deletions(-) diff --git a/src/Adminify.php b/src/Adminify.php index 35bedc1..d1e2738 100644 --- a/src/Adminify.php +++ b/src/Adminify.php @@ -2,6 +2,4 @@ namespace Nalcom\Adminify; -class Adminify -{ -} +class Adminify {} diff --git a/src/Commands/InstallationCommand.php b/src/Commands/InstallationCommand.php index 3dbbedc..e448b7a 100644 --- a/src/Commands/InstallationCommand.php +++ b/src/Commands/InstallationCommand.php @@ -16,14 +16,12 @@ class InstallationCommand extends Command public $description = 'Installs the Nalcom adminify laravel package'; - public $bar; public function handle(): int { $this->info('Initializing Package Installation... It will take some time! please be patient'); - $this->bar = $this->output->createProgressBar(26); $this->bar->advance(); @@ -62,10 +60,10 @@ public function handle(): int ->addValuesToEnvFiles() ->addRegisterMiddlewareToBreezeRoutes(); - copy(__DIR__ . '/../../stubs/config/translatable.php', config_path('translatable.php')); - copy(__DIR__ . '/../../stubs/config/localized-routes.php', config_path('localized-routes.php')); - copy(__DIR__ . '/../../stubs/config/laravel-translatable-string-exporter.php', config_path('laravel-translatable-string-exporter.php')); - copy(__DIR__ . '/../../stubs/config/recaptcha.php', config_path('recaptcha.php')); + copy(__DIR__.'/../../stubs/config/translatable.php', config_path('translatable.php')); + copy(__DIR__.'/../../stubs/config/localized-routes.php', config_path('localized-routes.php')); + copy(__DIR__.'/../../stubs/config/laravel-translatable-string-exporter.php', config_path('laravel-translatable-string-exporter.php')); + copy(__DIR__.'/../../stubs/config/recaptcha.php', config_path('recaptcha.php')); $this->bar->advance(); @@ -131,9 +129,9 @@ public function publishTranslations(): static } (new Filesystem)->ensureDirectoryExists(lang_path('en')); - copy(__DIR__ . '/../../stubs/lang/en/adminify.php', lang_path('en/adminify.php')); + copy(__DIR__.'/../../stubs/lang/en/adminify.php', lang_path('en/adminify.php')); (new Filesystem)->ensureDirectoryExists(lang_path('el')); - copy(__DIR__ . '/../../stubs/lang/el/adminify.php', lang_path('el/adminify.php')); + copy(__DIR__.'/../../stubs/lang/el/adminify.php', lang_path('el/adminify.php')); return $this; } @@ -143,7 +141,6 @@ protected function replaceInFile($search, $replace, $path) file_put_contents($path, str_replace($search, $replace, file_get_contents($path))); } - protected function addRoutesToAppBootstrap(): static { $this->replaceInFile("health: '/up',", @@ -156,6 +153,7 @@ protected function addRoutesToAppBootstrap(): static } ", base_path('bootstrap/app.php') ); + return $this; } @@ -164,45 +162,45 @@ protected function installNodeDependencies(): void $this->updateNodePackages(function ($packages) { return [ - '@ckeditor/ckeditor5-autoformat' => '^37.0.1', - '@ckeditor/ckeditor5-basic-styles' => '^37.0.1', - '@ckeditor/ckeditor5-block-quote' => '^37.0.1', - '@ckeditor/ckeditor5-cloud-services' => '^37.0.1', - '@ckeditor/ckeditor5-editor-classic' => '^37.0.1', - '@ckeditor/ckeditor5-essentials' => '^37.0.1', - '@ckeditor/ckeditor5-font' => '^37.0.1', - '@ckeditor/ckeditor5-heading' => '^37.0.1', - '@ckeditor/ckeditor5-image' => '^37.0.1', - '@ckeditor/ckeditor5-indent' => '^37.0.1', - '@ckeditor/ckeditor5-link' => '^37.0.1', - '@ckeditor/ckeditor5-list' => '^37.0.1', - '@ckeditor/ckeditor5-media-embed' => '^37.0.1', - '@ckeditor/ckeditor5-alignment' => '^37.0.1', - '@ckeditor/ckeditor5-paragraph' => '^37.0.1', - '@ckeditor/ckeditor5-paste-from-office' => '^37.0.1', - '@ckeditor/ckeditor5-table' => '^37.0.1', - '@ckeditor/ckeditor5-theme-lark' => '^37.0.1', - '@ckeditor/ckeditor5-typing' => '^37.0.1', - '@ckeditor/ckeditor5-upload' => '^37.0.1', - '@ckeditor/vite-plugin-ckeditor5' => '^0.1.1', - 'toastify-js' => '^1.12.0', - 'chart.js' => '^4.4.0', - 'chartjs-chart-geo' => '^4.2.7', - 'flatpickr' => '^4.6.13', - 'flowbite' => '^1.6.3', - 'moment' => '^2.29.4', - 'lodash' => '*', - 'filepond' => '^4.30.4', - 'filepond-plugin-file-metadata' => '^1.0.8', - 'filepond-plugin-file-poster' => '^2.5.1', - 'filepond-plugin-image-preview' => '^4.6.11', - ] + $packages; + '@ckeditor/ckeditor5-autoformat' => '^37.0.1', + '@ckeditor/ckeditor5-basic-styles' => '^37.0.1', + '@ckeditor/ckeditor5-block-quote' => '^37.0.1', + '@ckeditor/ckeditor5-cloud-services' => '^37.0.1', + '@ckeditor/ckeditor5-editor-classic' => '^37.0.1', + '@ckeditor/ckeditor5-essentials' => '^37.0.1', + '@ckeditor/ckeditor5-font' => '^37.0.1', + '@ckeditor/ckeditor5-heading' => '^37.0.1', + '@ckeditor/ckeditor5-image' => '^37.0.1', + '@ckeditor/ckeditor5-indent' => '^37.0.1', + '@ckeditor/ckeditor5-link' => '^37.0.1', + '@ckeditor/ckeditor5-list' => '^37.0.1', + '@ckeditor/ckeditor5-media-embed' => '^37.0.1', + '@ckeditor/ckeditor5-alignment' => '^37.0.1', + '@ckeditor/ckeditor5-paragraph' => '^37.0.1', + '@ckeditor/ckeditor5-paste-from-office' => '^37.0.1', + '@ckeditor/ckeditor5-table' => '^37.0.1', + '@ckeditor/ckeditor5-theme-lark' => '^37.0.1', + '@ckeditor/ckeditor5-typing' => '^37.0.1', + '@ckeditor/ckeditor5-upload' => '^37.0.1', + '@ckeditor/vite-plugin-ckeditor5' => '^0.1.1', + 'toastify-js' => '^1.12.0', + 'chart.js' => '^4.4.0', + 'chartjs-chart-geo' => '^4.2.7', + 'flatpickr' => '^4.6.13', + 'flowbite' => '^1.6.3', + 'moment' => '^2.29.4', + 'lodash' => '*', + 'filepond' => '^4.30.4', + 'filepond-plugin-file-metadata' => '^1.0.8', + 'filepond-plugin-file-poster' => '^2.5.1', + 'filepond-plugin-image-preview' => '^4.6.11', + ] + $packages; }, false); } protected function updateNodePackages(callable $callback, $dev = true): void { - if (!file_exists(base_path('package.json'))) { + if (! file_exists(base_path('package.json'))) { return; } @@ -219,7 +217,7 @@ protected function updateNodePackages(callable $callback, $dev = true): void file_put_contents( base_path('package.json'), - json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL + json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL ); $this->bar->advance(); @@ -229,7 +227,7 @@ public function installControllers(): static { //Controllers (new Filesystem)->ensureDirectoryExists(app_path('Http/Controllers/Admin/Adminify')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Http/Controllers', app_path('Http/Controllers/Admin/Adminify')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Http/Controllers', app_path('Http/Controllers/Admin/Adminify')); $this->bar->advance(); @@ -239,7 +237,7 @@ public function installControllers(): static public function installTraits(): static { (new Filesystem)->ensureDirectoryExists(app_path('Traits')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Traits', app_path('Traits')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Traits', app_path('Traits')); $this->bar->advance(); return $this; @@ -249,7 +247,7 @@ public function installServiceClasses(): static { //Services (new Filesystem)->ensureDirectoryExists(app_path('Services')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Services', app_path('Services')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Services', app_path('Services')); $this->bar->advance(); return $this; @@ -259,7 +257,7 @@ public function installValidationRules(): static { //Rules (new Filesystem)->ensureDirectoryExists(app_path('Rules')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Rules', app_path('Rules')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Rules', app_path('Rules')); $this->bar->advance(); return $this; @@ -269,7 +267,7 @@ public function installModels(): static { (new Filesystem)->ensureDirectoryExists(app_path('Models')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Models', app_path('Models')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Models', app_path('Models')); $this->bar->advance(); @@ -280,7 +278,7 @@ public function installMailables(): static { (new Filesystem())->ensureDirectoryExists(app_path('Mail')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Mail', app_path('Mail')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Mail', app_path('Mail')); return $this; } @@ -289,7 +287,7 @@ public function installRequests(): static { //Requests (new Filesystem)->ensureDirectoryExists(app_path('Http/Requests')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Http/Requests', app_path('Http/Requests/Admin/Adminify')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Http/Requests', app_path('Http/Requests/Admin/Adminify')); $this->bar->advance(); return $this; @@ -298,7 +296,7 @@ public function installRequests(): static public function publishConstants(): static { (new Filesystem)->ensureDirectoryExists(app_path('Constants')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Constants', app_path('Constants')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Constants', app_path('Constants')); $this->bar->advance(); return $this; @@ -307,7 +305,7 @@ public function publishConstants(): static public function installPolicies(): static { (new Filesystem)->ensureDirectoryExists(app_path('Policies')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/Policies', app_path('Policies')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/Policies', app_path('Policies')); $this->bar->advance(); return $this; @@ -317,25 +315,25 @@ public function installFrontEndResources(): static { // Views... (new Filesystem)->ensureDirectoryExists(resource_path()); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources', resource_path()); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources', resource_path()); //App-folder-views (new Filesystem)->ensureDirectoryExists(app_path('View')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/app/View', app_path('View')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/app/View', app_path('View')); //Javascript Files... (new Filesystem)->ensureDirectoryExists(resource_path('js')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/js', resource_path('js')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources/js', resource_path('js')); //CSS Files... (new Filesystem)->ensureDirectoryExists(resource_path('css')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/css', resource_path('css')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources/css', resource_path('css')); - copy(__DIR__ . '/../../stubs/tailwind.config.js', base_path('tailwind.config.js')); - copy(__DIR__ . '/../../stubs/vite.config.js', base_path('vite.config.js')); + copy(__DIR__.'/../../stubs/tailwind.config.js', base_path('tailwind.config.js')); + copy(__DIR__.'/../../stubs/vite.config.js', base_path('vite.config.js')); (new Filesystem)->ensureDirectoryExists(resource_path('images')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/images', resource_path('images')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources/images', resource_path('images')); $this->bar->advance(); return $this; @@ -344,7 +342,7 @@ public function installFrontEndResources(): static public function installProviders(): static { //Providers - copy(__DIR__ . '/../../stubs/app/Providers/AppServiceProvider.php', app_path('Providers/AppServiceProvider.php')); + copy(__DIR__.'/../../stubs/app/Providers/AppServiceProvider.php', app_path('Providers/AppServiceProvider.php')); $this->bar->advance(); @@ -356,7 +354,7 @@ public function installSettings(): static (new Filesystem)->ensureDirectoryExists(storage_path('app/analytics')); //Settings json file (new Filesystem)->ensureDirectoryExists(storage_path('app/settings')); - (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/storage/app/settings', storage_path('app/settings')); + (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/storage/app/settings', storage_path('app/settings')); $this->bar->advance(); return $this; @@ -367,8 +365,8 @@ public function copyMiddlewareClasses(): static //Middleware Files... (new Filesystem)->ensureDirectoryExists(app_path('Http/Middleware')); - copy(__DIR__ . '/../../stubs/app/Http/Middleware/RegistrationEnabled.php', app_path('Http/Middleware/RegistrationEnabled.php')); - copy(__DIR__ . '/../../stubs/app/Http/Middleware/CanAccessDashboard.php', app_path('Http/Middleware/CanAccessDashboard.php')); + copy(__DIR__.'/../../stubs/app/Http/Middleware/RegistrationEnabled.php', app_path('Http/Middleware/RegistrationEnabled.php')); + copy(__DIR__.'/../../stubs/app/Http/Middleware/CanAccessDashboard.php', app_path('Http/Middleware/CanAccessDashboard.php')); $this->bar->advance(); return $this; @@ -378,10 +376,9 @@ public function addMiddlewareToHttpKernel(): static { $this->installMiddlewareAliases([ 'registration.setting' => '\App\Http\Middleware\RegistrationEnabled::class', - 'canAccessDashboard' => '\App\Http\Middleware\CanAccessDashboard::class' + 'canAccessDashboard' => '\App\Http\Middleware\CanAccessDashboard::class', ]); - $this->bar->advance(); return $this; @@ -392,17 +389,17 @@ protected function installMiddleware($names, $group = 'web', $modifier = 'append $bootstrapApp = file_get_contents(base_path('bootstrap/app.php')); $names = collect(Arr::wrap($names)) - ->filter(fn($name) => !Str::contains($bootstrapApp, $name)) + ->filter(fn ($name) => ! Str::contains($bootstrapApp, $name)) ->whenNotEmpty(function ($names) use ($bootstrapApp, $group, $modifier) { - $names = $names->map(fn($name) => "$name")->implode(',' . PHP_EOL . ' '); + $names = $names->map(fn ($name) => "$name")->implode(','.PHP_EOL.' '); $bootstrapApp = str_replace( '->withMiddleware(function (Middleware $middleware) {', '->withMiddleware(function (Middleware $middleware) {' - . PHP_EOL . " \$middleware->$group($modifier: [" - . PHP_EOL . " $names," - . PHP_EOL . ' ]);' - . PHP_EOL, + .PHP_EOL." \$middleware->$group($modifier: [" + .PHP_EOL." $names," + .PHP_EOL.' ]);' + .PHP_EOL, $bootstrapApp, ); @@ -410,23 +407,22 @@ protected function installMiddleware($names, $group = 'web', $modifier = 'append }); } - protected function installMiddlewareAliases($aliases) { $bootstrapApp = file_get_contents(base_path('bootstrap/app.php')); $aliases = collect($aliases) - ->filter(fn($alias) => !Str::contains($bootstrapApp, $alias)) + ->filter(fn ($alias) => ! Str::contains($bootstrapApp, $alias)) ->whenNotEmpty(function ($aliases) use ($bootstrapApp) { - $aliases = $aliases->map(fn($name, $alias) => "'$alias' => $name")->implode(',' . PHP_EOL . ' '); + $aliases = $aliases->map(fn ($name, $alias) => "'$alias' => $name")->implode(','.PHP_EOL.' '); $bootstrapApp = str_replace( '->withMiddleware(function (Middleware $middleware) {', '->withMiddleware(function (Middleware $middleware) {' - . PHP_EOL . ' $middleware->alias([' - . PHP_EOL . " $aliases," - . PHP_EOL . ' ]);' - . PHP_EOL, + .PHP_EOL.' $middleware->alias([' + .PHP_EOL." $aliases," + .PHP_EOL.' ]);' + .PHP_EOL, $bootstrapApp, ); @@ -434,18 +430,17 @@ protected function installMiddlewareAliases($aliases) }); } - public function addRegisterMiddlewareToBreezeRoutes(): static { $route1 = " Route::get('register', [RegisteredUserController::class, 'create'])"; $route2 = "Route::post('register', [RegisteredUserController::class, 'store'])"; $middlewareCode = "->middleware('registration.setting')"; - if (!Str::contains($route1, $middlewareCode)) { - $this->replaceInFile($route1, $route1 . $middlewareCode, base_path('routes/auth.php')); + if (! Str::contains($route1, $middlewareCode)) { + $this->replaceInFile($route1, $route1.$middlewareCode, base_path('routes/auth.php')); } - if (!Str::contains($route2, $middlewareCode)) { - $this->replaceInFile($route2, $route2 . $middlewareCode, base_path('routes/auth.php')); + if (! Str::contains($route2, $middlewareCode)) { + $this->replaceInFile($route2, $route2.$middlewareCode, base_path('routes/auth.php')); } $this->bar->advance(); @@ -456,22 +451,22 @@ public function installRoutesFile(): static { //Routes (new Filesystem)->ensureDirectoryExists(base_path('routes')); - copy(__DIR__ . '/../../stubs/routes/adminify.php', base_path('routes/adminify.php')); - - File::put(base_path('routes/web.php'), ' Post::withTranslation()" . PHP_EOL . - " ->with(['categories.translations', 'tags.translations', 'media'])" . PHP_EOL . - ' ->latest()' . PHP_EOL . - ' ->limit(3)' . PHP_EOL . - ' ->get()' . PHP_EOL . - ' ]);' . PHP_EOL . - '});' . PHP_EOL . PHP_EOL . - "require __DIR__ . '/adminify.php';" . PHP_EOL . - "require __DIR__ . '/auth.php';" . PHP_EOL + copy(__DIR__.'/../../stubs/routes/adminify.php', base_path('routes/adminify.php')); + + File::put(base_path('routes/web.php'), ' Post::withTranslation()".PHP_EOL. + " ->with(['categories.translations', 'tags.translations', 'media'])".PHP_EOL. + ' ->latest()'.PHP_EOL. + ' ->limit(3)'.PHP_EOL. + ' ->get()'.PHP_EOL. + ' ]);'.PHP_EOL. + '});'.PHP_EOL.PHP_EOL. + "require __DIR__ . '/adminify.php';".PHP_EOL. + "require __DIR__ . '/auth.php';".PHP_EOL ); $this->bar->advance(); @@ -482,17 +477,17 @@ public function addValuesToEnvFiles(array $additionalEnvValues = []): static { $fields = array_merge( [ - PHP_EOL . 'GOOGLE_ANALYTICS_PROPERTY_ID=' . PHP_EOL, - 'GOOGLE_SERVICE_ACCOUNT_CREDENTIALS=' . PHP_EOL, - PHP_EOL . 'RECAPTCHA_SITE_KEY=' . PHP_EOL, - 'RECAPTCHA_SECRET_KEY=' . PHP_EOL, - 'RECAPTCHA_SKIP_IP=' . PHP_EOL, + PHP_EOL.'GOOGLE_ANALYTICS_PROPERTY_ID='.PHP_EOL, + 'GOOGLE_SERVICE_ACCOUNT_CREDENTIALS='.PHP_EOL, + PHP_EOL.'RECAPTCHA_SITE_KEY='.PHP_EOL, + 'RECAPTCHA_SECRET_KEY='.PHP_EOL, + 'RECAPTCHA_SKIP_IP='.PHP_EOL, ], $additionalEnvValues); if (file_exists(base_path('.env'))) { $envContent = file_get_contents(base_path('.env')); foreach ($fields as $field) { - if (!str_contains($envContent, $field)) { + if (! str_contains($envContent, $field)) { file_put_contents('.env', $field, FILE_APPEND); } } @@ -501,7 +496,7 @@ public function addValuesToEnvFiles(array $additionalEnvValues = []): static if (file_exists(base_path('.env.example'))) { $envContent = file_get_contents(base_path('.env.example')); foreach ($fields as $field) { - if (!str_contains($envContent, $field)) { + if (! str_contains($envContent, $field)) { file_put_contents('.env.example', $field, FILE_APPEND); } } @@ -513,8 +508,8 @@ public function addValuesToEnvFiles(array $additionalEnvValues = []): static public function replaceAppConfigFile(): static { - $this->replaceInFile("locale =>", "'locale' => Valuestore::make(storage_path('app/settings/settings.json'))->get('default_locale'),", config_path('app.php')); - $this->replaceInFile("fallback_locale =>", "'fallback_locale' => Valuestore::make(storage_path('app/settings/settings.json'))->get('fallback_locale'),", config_path('app.php')); + $this->replaceInFile('locale =>', "'locale' => Valuestore::make(storage_path('app/settings/settings.json'))->get('default_locale'),", config_path('app.php')); + $this->replaceInFile('fallback_locale =>', "'fallback_locale' => Valuestore::make(storage_path('app/settings/settings.json'))->get('fallback_locale'),", config_path('app.php')); $this->bar->advance(); @@ -526,15 +521,15 @@ public function execShellCommand($command): void $output = []; $exitCode = 0; - exec($command . ' 2>&1', $output, $exitCode); + exec($command.' 2>&1', $output, $exitCode); if ($exitCode == 0) { // command was successful, do not print the output } else { - $this->error('Command failed with exit code: ' . $exitCode . PHP_EOL); - $this->error('Error log: ' . PHP_EOL); + $this->error('Command failed with exit code: '.$exitCode.PHP_EOL); + $this->error('Error log: '.PHP_EOL); foreach ($output as $line) { - $this->error($line . PHP_EOL); + $this->error($line.PHP_EOL); } } $this->bar->advance(); diff --git a/stubs/app/Mail/ContactMail.php b/stubs/app/Mail/ContactMail.php index 0b8a432..1197dfd 100644 --- a/stubs/app/Mail/ContactMail.php +++ b/stubs/app/Mail/ContactMail.php @@ -15,8 +15,7 @@ class ContactMail extends Mailable public function __construct( public ContactMailModel $contact - ) { - } + ) {} /** * Get the message envelope. diff --git a/stubs/app/Rules/InPublishedLanguagesArray.php b/stubs/app/Rules/InPublishedLanguagesArray.php index a307238..50f2e25 100644 --- a/stubs/app/Rules/InPublishedLanguagesArray.php +++ b/stubs/app/Rules/InPublishedLanguagesArray.php @@ -9,10 +9,7 @@ class InPublishedLanguagesArray implements Rule { use Multilingual; - public function __construct() - { - - } + public function __construct() {} public function passes($attribute, $value): bool {