[ "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:----N/RYOTgjNoc1le7sArvVaUAkXsoziW3fRv9asTtIXrdf43qJC4eOaW7JiIKLb2HYDDY1yDYsJ3NhuaSoWxS4taUexk5Wa6DUrx2LaBB/ugPUNftX+OxNZ060/K1CE5dTpOEIEwVfEHeahuclu1sn8XVvckUQI0Wc1t3KlQ0XpkOG8ePqqMYjbQm5iBb2DcaR8mjGKZ8p1hO2wj3qGksY10RNAb2BNxQ017wZOniOxOp60mRiMIHGGsUbvgxYnxTKI90N3ZnkblaVfEK3dhx79fLyDP3donFeFJIku8mBJbbyOVm4/QA8g805B1HHeMfi6oIYKACGqQC9lT/Zek0cGVvJwpX2kVcTr0TMQDJL8K6z/3Fadb4LlWybasuJQIcH9i0RIeShUfeKlB6nIulgQXU+oyULBLiL9jHCaTnG31NgrYdk/9XmSGnietIzX78G1NJZKJinuaOv/LHDdQkfMkGltlHLEKL/eHCd2h1oL6qcMuf8Wk5ck8Ha0ft5cHd3JyLgF+Fz6+fLF/PMRUHI4OmM6XsORVnqcnYmu4Wkk9KcwDJI31O/KIBDYeOAcAi8Ssy5FnzpaBx9oG8QI8w/V75+zZzV0IZ4ZUq3Lqw6rf2+v1xG69TMww40gun6zWIxycjfsXvfaMU72rsvNTeRofIy7sycOpsNqG+U88d7ySk=----ATTACHMENT:----NzIwNzUzNjQwODg2NjUxOCAyNDM4MDAxNTQ3MDEwNDUgODE0MTA1NTcwMTQ3OTcxMw==