8000 Merge pull request #81 from shanerbaner82/main · me-shaon/nativephp-laravel@2a2fd25 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a2fd25

Browse files
authored
Merge pull request NativePHP#81 from shanerbaner82/main
Adds 'php artisan native:migrate fresh' command
2 parents a4605f0 + 46d896e commit 2a2fd25

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Commands/FreshCommand.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Native\Laravel\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use Native\Laravel\NativeServiceProvider;
7+
8+
class FreshCommand extends Command
9+
{
10+
protected $description = 'Run the database migrations in the NativePHP development environment';
11+
12+
protected $signature = 'native:migrate fresh';
13+
14+
public function handle()
15+
{
16+
unlink(config('nativephp-internal.database_path'));
17+
18+
(new NativeServiceProvider($this->laravel))->rewriteDatabase();
19+
20+
$this->call('native:migrate');
21+
}
22+
23+
}

0 commit comments

Comments
 (0)
0