['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:----tzzZkVZAY6pPutK870mO3RJLvIA0l1a3/pD3Z7D3bEO3raXJqxU3kX6ZQOIQhktFMcskSJhw3KASJmtx0bhOvwgHr1PsKyc4oQlkB50H+vMMC047Kcdx4dUCbOtbZrosxnT6NGoMksOlzE3pyIkMP8COLNTuu/PtqmTP09v5KYPUIazXYeODC7i43cVRyUP2wQaGz8xmfRPDLS7IP0SQ3P0MUCPc92EivDEtYW6zeGqr0RkoMxm0Mx8wystascuoTubRvb41++/yTkiLNX+BxM9IRixpxc2Jvzh4vAKS1KAOyRPr1sN6v+byte4hw/4KSUcUQQPmBckGGZtwBVgm9ENocw6wUan0zW3RuVXLIzJtrE2UFq2t4/riNhDjcBFniheAtJ1TehH2H3LZeSnvIMl8xDskbOBCGxF6yLQ75ptFOhQpCdhLiy1tiDyc0w5s8+rBMEZmOE6pfo85ObTXlZRKSeVKnYC+ETiayVjYqPsJ47ewE/Pzt2XzYcdkPTfGM3Qd71t/GCS9xEzSb+NIEgpxYOAvzluSqqd65XN9ObTauYIv3x8cevCPjft/KiTwGWMtaeqriXUP57lb4kfZnlE42aiexOxkl7gGmbgIoCWTjyYUAw/d4rO0AomPeSt1oV5TEG20aU1GKCoJOyHMkVEz101bcbxQeSQ0X0XEHxk=----ATTACHMENT:----MzQzOTM0OTU1Nzg4NTM3MSA3MjYwOTk3Nzc4MjQ0NjUwIDU0ODM3NTY2NjQxMTA3MzQ=