diff --git a/src/Console/NaviMakeCommand.php b/src/Console/NaviMakeCommand.php index 85867e4..c56f91e 100644 --- a/src/Console/NaviMakeCommand.php +++ b/src/Console/NaviMakeCommand.php @@ -41,9 +41,28 @@ public function handle() return false; } - $name = strtolower(trim($this->argument('name'))); + $component = Str::of($this->argument('name')) + ->lower() + ->trim(); - $this->components->info("Navi component is ready for use."); + $default = $this->option('default') ?? 'primary_navigation'; + + $locations = collect(get_registered_nav_menus()) + ->take(5) + ->map(fn ($name, $slug) => $slug === $default + ? "{$name}: " + : "{$name}: " + ); + + $this->components->info("Navi component is ready for use."); + + if ($locations->isEmpty()) { + $this->components->warn('Your theme does not appear to have any registered navigation menu locations.'); + + return; + } + + $this->components->bulletList($locations->all()); } /**