-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dao quang huy
committed
Jul 20, 2024
1 parent
c5158ce
commit e7cc44a
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
namespace CSlant\BlogApi\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class BlogApiServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Bootstrap services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot(): void | ||
{ | ||
$routePath = __DIR__.'/../../routes/blog-api.php'; | ||
if (file_exists($routePath)) { | ||
$this->loadRoutesFrom($routePath); | ||
} | ||
|
||
$this->loadTranslationsFrom(__DIR__.'/../../lang', 'blog-api'); | ||
|
||
$this->registerCommands(); | ||
|
||
$this->registerAssetPublishing(); | ||
} | ||
|
||
/** | ||
* Register services. | ||
* | ||
* @return void | ||
*/ | ||
public function register(): void | ||
{ | ||
$configPath = __DIR__.'/../../config/blog-api.php'; | ||
$this->mergeConfigFrom($configPath, 'blog-api'); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array<string>|null | ||
*/ | ||
public function provides(): ?array | ||
{ | ||
return ['blog-api']; | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
protected function registerCommands(): void | ||
{ | ||
$this->commands([ | ||
// | ||
]); | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
protected function registerAssetPublishing(): void | ||
{ | ||
$configPath = __DIR__.'/../../config/blog-api.php'; | ||
$this->publishes([ | ||
$configPath => config_path('blog-api.php'), | ||
], 'config'); | ||
|
||
$this->publishes([ | ||
__DIR__.'/../../lang' => resource_path('lang/packages/blog-api'), | ||
], 'lang'); | ||
} | ||
} |