8000 feat: add WipeDatabaseCommand for database management (#594) · NativePHP/laravel@e97a405 · GitHub
[go: up one dir, main page]

Skip to content

Commit e97a405

Browse files
authored
feat: add WipeDatabaseCommand for database management (#594)
Introduced the WipeDatabaseCommand to streamline database wiping in the NativePHP development environment.
1 parent 787a9d6 commit e97a405

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Commands/WipeDatabaseCommand.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Native\Laravel\Commands;
4+
5+
use Illuminate\Database\Console\WipeCommand as BaseWipeCommand;
6+
use Native\Laravel\NativeServiceProvider;
7+
8+
class WipeDatabaseCommand extends BaseWipeCommand
9+
{
10+
protected $name = 'native:db:wipe';
11+
12+
protected $description = 'Wipe the database in the NativePHP development environment';
13+
14+
public function handle()
15+
{
16+
(new NativeServiceProvider($this->laravel))->rewriteDatabase();
17+
18+
return parent::handle();
19+
}
20+
}

src/NativeServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Native\Laravel\Commands\LoadStartupConfigurationCommand;
1616
use Native\Laravel\Commands\MigrateCommand;
1717
use Native\Laravel\Commands\SeedDatabaseCommand;
18+
use Native\Laravel\Commands\WipeDatabaseCommand;
1819
use Native\Laravel\Contracts\ChildProcess as ChildProcessContract;
1920
use Native\Laravel\Contracts\GlobalShortcut as GlobalShortcutContract;
2021
use Native\Laravel\Contracts\PowerMonitor as PowerMonitorContract;
@@ -42,6 +43,7 @@ public function configurePackage(Package $package): void
4243
FreshCommand::class,
4344
MigrateCommand::class,
4445
SeedDatabaseCommand::class,
46+
WipeDatabaseCommand::class,
4547
])
4648
->hasConfigFile()
4749
->hasRoute('api')

0 commit comments

Comments
 (0)
0