Commit 15ebb18 1 parent e46ac69 commit 15ebb18 Copy full SHA for 15ebb18
File tree 3 files changed +9
-11
lines changed
3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 6
6
namespace App \Console \Commands ;
7
7
8
8
use Illuminate \Database \Console \Migrations \FreshCommand ;
9
+ use Symfony \Component \Console \Attribute \AsCommand ;
9
10
use Symfony \Component \Console \Input \InputOption ;
10
11
12
+ #[AsCommand(name: 'migrate:fresh ' )]
11
13
class MigrateFreshAllCommand extends FreshCommand
12
14
{
13
15
public function handle ()
Original file line number Diff line number Diff line change 6
6
namespace App \Providers ;
7
7
8
8
use App \Console \Commands \MigrateFreshAllCommand ;
9
- use Illuminate \Support \ServiceProvider ;
9
+ use Illuminate \Database \Console \Migrations \FreshCommand ;
10
+ use Illuminate \Database \MigrationServiceProvider as BaseProvider ;
10
11
11
- class MigrationServiceProvider extends ServiceProvider
12
+ class MigrationServiceProvider extends BaseProvider
12
13
{
13
- /**
14
- * Register the service provider.
15
- *
16
- * @return void
17
- */
18
- public function register ()
14
+ #[\Override]
15
+ public function registerMigrateFreshCommand ()
19
16
{
20
- $ this ->app ->extend ('command.migrate.fresh ' , function () {
21
- return new MigrateFreshAllCommand ();
22
- });
17
+ $ this ->app ->singleton (FreshCommand::class, MigrateFreshAllCommand::class);
23
18
}
24
19
}
Original file line number Diff line number Diff line change 178
178
179
179
'providers ' => ServiceProvider::defaultProviders ()->except ([
180
180
Illuminate \Cookie \CookieServiceProvider::class,
181
+ Illuminate \Database \MigrationServiceProvider::class,
181
182
Illuminate \Session \SessionServiceProvider::class,
182
183
])->merge ([
183
184
App \Providers \AppServiceProvider::class,
You can’t perform that action at this time.
0 commit comments