Skip to content

Commit

Permalink
Refactor migration handling in VerbsServiceProvider
Browse files Browse the repository at this point in the history
Removing timestamped prefixes and registering them directly in the service provider using `hasMigrations`. Removed manual publishing and loading of migrations.
  • Loading branch information
dev-idkwhoami committed Jan 20, 2025
1 parent 64fbd09 commit c43e662
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/VerbsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public function configurePackage(Package $package): void
$package
->name('verbs')
->hasConfigFile()
->hasMigrations([
'create_verb_events_table',
'create_verb_snapshots_table',
'create_verb_state_events_table',
])
->hasCommands(
MakeVerbEventCommand::class,
MakeVerbStateCommand::class,
Expand Down Expand Up @@ -144,12 +149,6 @@ classDiscriminatorResolver: new ClassDiscriminatorFromClassMetadata(new ClassMet

public function packageBooted()
{
$this->publishes([
__DIR__.'/../database/migrations/' => database_path('migrations'),
], "{$this->package->shortName()}-migrations");

$this->loadMigrationsFrom(__DIR__.'/../database/migrations');

if ($this->app->has('livewire')) {
$manager = $this->app->make('livewire');

Expand Down

0 comments on commit c43e662

Please sign in to comment.