66
77use Illuminate \Console \Command ;
88use Illuminate \Support \Facades \File ;
9+ use Laravel \Prompts \Concerns \Colors ;
10+
11+ use function Laravel \Prompts \intro ;
12+ use function Laravel \Prompts \note ;
913
1014class InstallCommand extends Command
1115{
16+ use Colors;
1217 protected $ signature = 'restify-boost:install ' ;
1318
1419 protected $ description = 'Install and configure the Restify Boost package ' ;
1520
1621 public function handle (): int
1722 {
23+ $ this ->displayRestifyHeader ();
1824 $ this ->displayWelcome ();
1925
2026 // Publish configuration file
@@ -24,16 +30,6 @@ public function handle(): int
2430 '--force ' => true ,
2531 ]);
2632
27- // Verify Laravel Restify is installed
28- $ this ->line ('Checking Laravel Restify installation... ' );
29- if (! $ this ->verifyRestifyInstallation ()) {
30- $ this ->error ('Laravel Restify package not found! ' );
31- $ this ->line ('Please install Laravel Restify first: ' );
32- $ this ->line ('composer require binaryk/laravel-restify ' );
33-
34- return self ::FAILURE ;
35- }
36-
3733 // Check documentation availability
3834 $ this ->line ('Checking documentation availability... ' );
3935 $ this ->checkDocumentationPaths ();
@@ -49,12 +45,29 @@ public function handle(): int
4945 return self ::SUCCESS ;
5046 }
5147
48+ private function displayRestifyHeader (): void
49+ {
50+ note ($ this ->restifyLogo ());
51+ intro ('✦ Laravel Restify MCP :: Install :: We Must REST ✦ ' );
52+ }
53+
54+ private function restifyLogo (): string
55+ {
56+ return
57+ <<<'HEADER'
58+ ██████╗ ███████╗ ███████╗ ████████╗ ██╗ ███████╗ ██╗ ██╗
59+ ██╔══██╗ ██╔════╝ ██╔════╝ ╚══██╔══╝ ██║ ██╔════╝ ╚██╗ ██╔╝
60+ ██████╔╝ █████╗ ███████╗ ██║ ██║ █████╗ ╚████╔╝
61+ ██╔══██╗ ██╔══╝ ╚════██║ ██║ ██║ ██╔══╝ ╚██╔╝
62+ ██║ ██║ ███████╗ ███████║ ██║ ██║ ██║ ██║
63+ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
64+ HEADER;
65+ }
66+
5267 protected function displayWelcome (): void
5368 {
54- $ this ->newLine ();
55- $ this ->info ('┌─────────────────────────────────────────┐ ' );
56- $ this ->info ('│ Restify Boost Setup │ ' );
57- $ this ->info ('└─────────────────────────────────────────┘ ' );
69+ $ appName = config ('app.name ' , 'Your Laravel App ' );
70+ note ("Let's give {$ this ->bgBlue ($ this ->white ($ this ->bold ($ appName )))} a RESTful boost with Restify MCP! " );
5871 $ this ->newLine ();
5972 $ this ->line ('This will set up Restify Boost to provide Laravel Restify ' );
6073 $ this ->line ('documentation access to AI assistants like Claude Code. ' );
@@ -278,26 +291,6 @@ protected function createMcpConfigFile(): bool
278291 }
279292 }
280293
281- protected function verifyRestifyInstallation (): bool
282- {
283- // Check if Laravel Restify is in composer.lock
284- $ composerLock = base_path ('composer.lock ' );
285- if (! File::exists ($ composerLock )) {
286- return false ;
287- }
288-
289- $ lockData = json_decode (File::get ($ composerLock ), true );
290- foreach (($ lockData ['packages ' ] ?? []) as $ package ) {
291- if ($ package ['name ' ] === 'binaryk/laravel-restify ' ) {
292- $ this ->info ('Found Laravel Restify version: ' .$ package ['version ' ]);
293-
294- return true ;
295- }
296- }
297-
298- return false ;
299- }
300-
301294 protected function checkDocumentationPaths (): void
302295 {
303296 $ primaryPath = config ('restify-boost.docs.paths.primary ' );
0 commit comments