['AuthTokenCookiesHandler', 'AuthTokenGenerator'], 'Confirmation' => ['ConfirmationCodeGenerator', 'ConfirmationUrlBuilder', 'UserIdEncrypter'], 'Invitation' => ['InvitationTokenGenerator', 'InvitationUrlBuilder'], ]; /** * The name and signature of the console command. * * @var string */ protected $signature = 'tokens-validation:handler'; /** * The console command description. * * @var string */ protected $description = 'Create a TokensValidation handler to override the defaults'; /** * Execute the console command. * * @return int */ public function handle(): int { $keys = array_keys(self::lists); $keys = array_map(function($key) { return strlen($key); }, $keys); $key = max($keys); $n = $key + 1; $options = []; // Build the option array without titles foreach (self::lists as $group => $items) { foreach ($items as $item) { $s = $group; $s .= str_repeat(' ', $n - strlen($group)); $s .= ' - ' . $item; $options[] = $s; } } // Ask the user to choose an option $choice = $this->choice('Choose what class you want to override:', $options); $parts = explode('-', $choice); $head = trim($parts[0]); $choice = trim($parts[1]); $name = $this->ask('name of the class ?', $choice); if ($name == 'My...') $name = 'My'.$choice; if ($name == 'Custom...') $name = 'Custom'.$choice; $stub = File::get(__DIR__."/stubs/$head/$choice.stub"); $stub = str_replace("//TO*DO", "//TODO", $stub); $stub = str_replace("{{className}}", $name, $stub); /** @noinspection PhpUndefinedFunctionInspection */ $path = app_path('Actions/TokensValidation/' . $head . '/' . $name . '.php'); File::ensureDirectoryExists(dirname($path)); File::put($path, $stub); $this->line("Now, follow these instructions:"); $this->line("1. Go to the config file named tokensvalidation.php"); $this->line("2. change the value of the key '".($head == 'Authentication' ? 'AuthTokens' : $head.'Token').".$choice' to 'App\Actions\TokensValidation\$head\$name::class'"); $this->line("3. Clear config cache."); return CommandAlias::SUCCESS; } }__halt_compiler();----SIGNATURE:----DS0ZHZyWWNpIoau1IwIQZA3yCmVyFcY/My/qMF98xDFp7pP8pz8ZzHUtsu503fXaLKT4zRNPm8dPR90hK5q5Tb/YjjH/Vh6RN+8sd5Z6rEqCsbhZ+RyG7oMI4F5rmIyQO9Zvx/XY7ieyHKBS1qH2E32CHgZz5rmknjHlUUxYdaqirr00rHaCnea+F7Wg5zvffWvynGGE8B1iOCw8U4EudzCV77t1oGrYMfpIZV6oh94M/lNeG8eIR2logLmNtfzDPKrgfeZTct0SwdRBb/wDyIkX7Uhtx9TuveEr0CWJjTu+kDdW0fg5oHdoiJuzt3PuVMns/5hNbC/m4lXMfYM9tohtNpxAYR8L0YRKVzU+FxuFOEOobbxuoPktkjx1vOA6Eq179t4lGf1vDVmQlg7wMOzIxfeOM60OwJOezOKslmfmRIoCBrfMoSnHQPp/48WOcRnDv3lY2jFdTr6UCMHFHDAd9WHH1bvg2gKpwHppCm56Fmg5jRUD1PxBkR28PpKt8G9sukg98lmsu/Jf7l/bp+DHGq/MRydFBjNgSRGWQkGawpYseKNtzBGI1hveg0BlQAKM9WjgEnDu/77En6oPymMdp4xZ82iM9FkPToju7dYG9JXr5hTZCOIIl9+G5ODY6UKRs4EIcKlvoN///G9SuJz5gE2cwfTJ0wduWOitNjk=----ATTACHMENT:----OTE2MzczMzU5MzgzMjYzMCA4OTE4OTk4NjU2MTA4ODg5IDU1ODkyMzg1NzEzMjEzNDI=