Skip to content

Commit

Permalink
fix: Rephrase wording on install command
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniputra committed May 25, 2024
1 parent 6ae017e commit 357859e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use AntoniPutra\Ngeblog\NgeblogServiceProvider;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Schema;

use function Laravel\Prompts\confirm;

Expand All @@ -29,7 +30,7 @@ class InstallCommand extends Command
*/
public function handle()
{
if (file_exists(config_path('ngeblog.php'))) {
if (Schema::hasTable('ngeblog_posts') && file_exists(config_path('ngeblog.php'))) {
if (! $this->confirm('It seems this package is already installed. Would you like to proceed with the installation anyway?')) {
return;
}
Expand Down Expand Up @@ -58,11 +59,11 @@ protected function runDatabaseMigrations()
protected function installStarterPage()
{
$confirmed = confirm(
label: 'Do you want to install Starter Page scaffolding?',
default: false,
label: 'Do you want to install Starter Page?',
default: true,
yes: 'Yep, Please!',
no: 'Nope.',
// hint: ''
hint: 'It will give you "'. config('app.url') .'/blogs" with default basic layout written in blade syntax.'
);

if (! $confirmed) {
Expand All @@ -81,13 +82,12 @@ protected function installStarterPage()
$this->publicPageRouteDefinition()
);

$this->info('√ Controller generated "app/Http/Controllers/NgeblogPostController.php"'. PHP_EOL);
$this->info('Template generated "resources/views/ngeblog/*"'. PHP_EOL);
$this->info('[StarterPage] Controller generated "app/Http/Controllers/NgeblogPostController.php"'. PHP_EOL);
$this->info('[StarterPage] View generated "resources/views/ngeblog/*"'. PHP_EOL);

$this->info('√ Route generated "routes/ngeblog.php"'. PHP_EOL);
$this->info('√ Route has been included to your "routes/web.php"'. PHP_EOL);
$this->info('√ [StarterPage] Route generated "routes/ngeblog.php" and included to your "routes/web.php"'. PHP_EOL);

$this->components->info('Ngeblog Default Public Page scaffolding installed successfully.');
$this->components->info('Ngeblog Starter Page generated successfully.');
}

protected function publicPageRouteDefinition()
Expand Down

0 comments on commit 357859e

Please sign in to comment.