Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 399
Zeile 3... Zeile 3...
3
namespace Illuminate\Foundation\Console;
3
namespace Illuminate\Foundation\Console;
Zeile 4... Zeile 4...
4
 
4
 
5
use Illuminate\Console\GeneratorCommand;
5
use Illuminate\Console\GeneratorCommand;
6
use InvalidArgumentException;
6
use InvalidArgumentException;
-
 
7
use Symfony\Component\Console\Attribute\AsCommand;
7
use Symfony\Component\Console\Attribute\AsCommand;
8
use Symfony\Component\Console\Input\InputInterface;
-
 
9
use Symfony\Component\Console\Input\InputOption;
Zeile 8... Zeile 10...
8
use Symfony\Component\Console\Input\InputOption;
10
use Symfony\Component\Console\Output\OutputInterface;
9
 
11
 
10
#[AsCommand(name: 'make:observer')]
12
#[AsCommand(name: 'make:observer')]
11
class ObserverMakeCommand extends GeneratorCommand
13
class ObserverMakeCommand extends GeneratorCommand
Zeile 148... Zeile 150...
148
        return [
150
        return [
149
            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the observer already exists'],
151
            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the observer already exists'],
150
            ['model', 'm', InputOption::VALUE_OPTIONAL, 'The model that the observer applies to'],
152
            ['model', 'm', InputOption::VALUE_OPTIONAL, 'The model that the observer applies to'],
151
        ];
153
        ];
152
    }
154
    }
-
 
155
 
-
 
156
    /**
-
 
157
     * Interact further with the user if they were prompted for missing arguments.
-
 
158
     *
-
 
159
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
-
 
160
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
-
 
161
     * @return void
-
 
162
     */
-
 
163
    protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output)
-
 
164
    {
-
 
165
        if ($this->didReceiveOptions($input)) {
-
 
166
            return;
-
 
167
        }
-
 
168
 
-
 
169
        $model = $this->components->askWithCompletion(
-
 
170
            'What model should this observer apply to?',
-
 
171
            $this->possibleModels(),
-
 
172
            'none'
-
 
173
        );
-
 
174
 
-
 
175
        if ($model && $model !== 'none') {
-
 
176
            $input->setOption('model', $model);
-
 
177
        }
-
 
178
    }
153
}
179
}