[ "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:----NCTI5WPrmc33hrT2zGQOdTqLUmyEos5dYivbJ5Fq99GRHiYJ2ByDoNkzirob7hAvBrk6KsiaRc66YVO+tGIIfqoBwn1kNcRyd1UUTtuE6LxSEPMUHBhimFufpDGwjmXvwAOYzpdw1tU5DDjOX3xnklP0fgaopUpunOr08PKmkBxhmvMy3xLxMjRDpUPwHueOhNMAvXmuLI3BGBCIGHj9f7YKRwYwH4JtCFxhf4KAshphYf+6E9YQ/aZWYSf3t0eaLwAy/0PvNiIOLN8roxDUYdqd2e0gFEb98SQWiHRQPR0ehYS09PltA9Zy/tWHncDgzJDG4W13sP1rOqeCXcZs2oFf53UEDvsZGeGfoB+iaWD7G180634gDQ+Y+r8BpFNeiQ762TNK2d6lCeuu59STcywNfZn0cDEWe3rQP44YS+79qKdCFSS3zkmswOre/1+osidyMz8sUP6V1KKxxIdD/zaOI6olZuZXNj5J/D+ifObIxbead7d4/KvLYOj9VmRvU8C7DlgnZ8mG9+JNcRBh43c2WCbH5gp6P//zKNABmxON6eDmS4gfUb+z8W05hjj55xTYJP9efu1ajxB1Y6xe9jFMQAc9MDGWi/4ZPvEpPtcW1SC/W6DM72j+MuJ0uIXf9HQaLu8d1FYd9ituZnsmz3G52FVOo3Crj+BvjbLindo=----ATTACHMENT:----ODk3NDgyNDY0NDE4NDg4MiAyNzgyNTc0MzY0MTU2NDY4IDQyNDIyNzk3ODEzMDIxMw==