• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SameOldNick / SameOldWebsite / 15666164139

15 Jun 2025 06:29PM UTC coverage: 88.045% (+24.3%) from 63.784%
15666164139

push

github

SameOldNick
Fixed method name

28443 of 32305 relevant lines covered (88.05%)

702.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/Console/Commands/Setup/SetupDatabase.php
1
<?php
2

3
namespace App\Console\Commands\Setup;
4

5
use Illuminate\Console\Command;
6

7
class SetupDatabase extends Command
8
{
9
    /**
10
     * The name and signature of the console command.
11
     *
12
     * @var string
13
     */
14
    protected $signature = 'setup:database
15
                            {--y|yes : Proceed without asking for confirmation}';
16

17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Setup the database including migrations and seeding';
23

24
    /**
25
     * Execute the console command.
26
     */
27
    public function handle()
28
    {
29
        // Extract options
30
        $skipPrompt = $this->option('yes');
×
31

32
        // Function to confirm database setup
33
        $this->confirmDatabaseSetup($skipPrompt);
×
34

35
        // Run migrations
36
        $this->info('Running database migrations...');
×
37
        $this->call('migrate:fresh', []);
×
38

39
        // Populate countries and states
40
        $this->info('Populating countries and states...');
×
41
        $this->call('setup:countries');
×
42

43
        // Seed the database
44
        $this->info('Seeding the database...');
×
45
        $this->call('db:seed', ['--class' => 'SetupSeeder']);
×
46

47
        $this->info('Database setup complete.');
×
48
    }
49

50
    /**
51
     * Confirms database setup
52
     *
53
     * @return void
54
     */
55
    private function confirmDatabaseSetup(bool $skipPrompt)
56
    {
57
        if (! $skipPrompt) {
×
58
            if (! $this->confirm('This will erase everything in the database. Are you sure you want to continue?')) {
×
59
                $this->error('Cancelled database setup.');
×
60
                exit(1);
×
61
            }
62
        }
63
    }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc