Skip to content

Commit e518411

Browse files
committed
chore: fix service provider
Signed-off-by: Fery Wardiyanto <ferywardiyanto@gmail.com>
1 parent 16e4744 commit e518411

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Package/ServiceProvider.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,32 @@ public function register()
2323
});
2424

2525
$this->app->alias(Package::class, 'creasi.package');
26+
27+
if ($this->app->runningInConsole()) {
28+
$this->registerPublishables();
29+
30+
$this->registerCommands();
31+
}
32+
}
33+
34+
protected function registerPublishables()
35+
{
36+
$this->publishes([
37+
self::LIB_PATH.'/config/package.php' => \config_path('package.php'),
38+
], 'creasi-config');
39+
40+
$timestamp = date('Y_m_d_His', time());
41+
$migrations = self::LIB_PATH.'/database/migrations';
42+
43+
$this->publishes([
44+
$migrations.'/create_package_table.php' => database_path('migrations/'.$timestamp.'_create_package_table.php'),
45+
], 'creasi-migrations');
46+
47+
$this->loadMigrationsFrom($migrations);
48+
}
49+
50+
protected function registerCommands()
51+
{
52+
$this->commands([]);
2653
}
2754
}

0 commit comments

Comments
 (0)