Skip to content

Commit 365298c

Browse files
committed
Adeed dbm:migrate command
1 parent b948a4f commit 365298c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

config/dbm.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@
9292

9393
'views' => 'vendor/codexshaper/laravel-database-manager/publishable/views',
9494

95+
/*
96+
|-------------------------------------------------------------
97+
| Migration Path
98+
|-------------------------------------------------------------
99+
|
100+
| Set custom assests path so that you can load your own views
101+
|
102+
*/
103+
104+
'migrations' => 'vendor/codexshaper/laravel-database-manager/database/migrations',
105+
95106
/*
96107
|-------------------------------------------------------------
97108
| Flesystem

src/Commands/DatabaseMigrate.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace CodexShaper\DBM\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use Symfony\Component\Console\Input\InputOption;
7+
8+
class DatabaseMigrate extends Command
9+
{
10+
/**
11+
* The console command name.
12+
*
13+
* @var string
14+
*/
15+
protected $name = 'dbm:migrate';
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Migrate the Laravel Database Manager';
22+
23+
/**
24+
* Execute the console command.
25+
*
26+
* @param \Illuminate\Filesystem\Filesystem $filesystem
27+
*
28+
* @return void
29+
*/
30+
public function handle()
31+
{
32+
$migrationPath = config('dbm.migrations', '/vendor/codexshaper/laravel-database-manager/database/migrations');
33+
// Migrate Database
34+
$this->info('Migrating the database manager tables into your application');
35+
$this->call('migrate', ['--path' => $migrationPath, '--force' => 'force']);
36+
}
37+
}

0 commit comments

Comments
 (0)