['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:----1zs3y97prhSLOTJ1+8jWhNkRl7KjjQVlUErB0bcGNdR7rhPIKmHrdy/5HTg1B5aMZ4Jd6crLQIR4Un0YwcVieCxc96p+Tp7i3oZVZ/uu0GTi/OQI+JJ6zCfeoiKtAjein4iLPyKuDevprwXNLYrxUbzeMIZQEVWvI7VBKZpf0NWW5UipoZkFAYtcgwT9/VzQaC0Ujbk0C0ysH/K1Tj9ipqMBAB3WU2lK2BDdy9We2bc0xQpHIyA4ttSTp5yqfuOFFT3ZJNiswhXMAZXwJYJzTsqMDAPcCnSNoVEtshAzTFl2PBMjV0dl/pFpEvkbMJ3LYFPzSIAyTE1aaMk8MdECo56gnFSgVe1lAaxBhSe38Q6AVS2feMK3r34oRymTArsuAh7Gow7zASl4D1Paw3hk8dDswPjnRhSvm4vGX6/ZrTBQCcykOGx+ZIGWs862ZzKqJGMneLtCwOD4gwK5ZrrujkIeiJB1+D9prTPBGJ7dsJGyMQu5btVkhS3Po9+KI6Seh9Yy1+aO1yT5CHeYLAXTjUfAPP/OrWPXU3vW1CUFFChR027tL5Y5YwfF5lYIuMlZ1RbjQkCaj3JKTfWrNTWoKFZ4c9F5H4bqBCJ5NvWit3ELYeQGRImhtAyGgaOldmrfoNt7W2DAi98EyEK3mArufLPotkIlY7UVD7sFovLI9D4=----ATTACHMENT:----MTI3MjgxOTYxNjM1ODg3IDI4NDg2NTk3OTQ3NjMxMzAgNTM0NTEzNTk2Mjc2NzMyMQ==