addArgument('name', InputArgument::REQUIRED, 'The name of the scope') ->addArgument('description', InputArgument::OPTIONAL, 'The description of the scope'); } public function __invoke(ArgvInput | InputInterface $input, $output): int { $name = $input->getArgument('name'); $description = $input->getArgument('description') ?? ''; $scope = Scope::where('name', $name)->first(); if ($scope) { $output->error("Scope with name '$name' already exists."); return SympCommand::FAILURE; } $scope = new Scope(); $scope->name = $name; $scope->description = $description; $scope->save(); $output->green("Scope '$name' added successfully."); return SympCommand::SUCCESS; } }