-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
\LastDragon_ru\LaraASP\Spa\Provider
=> `\LastDragon_ru\LaraASP\Spa\…
…PackageProvider`.
- Loading branch information
1 parent
3b05adc
commit 2a1ba38
Showing
9 changed files
with
76 additions
and
53 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
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
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
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
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,49 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace LastDragon_ru\LaraASP\Spa; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use LastDragon_ru\LaraASP\Core\Provider\WithConfig; | ||
use LastDragon_ru\LaraASP\Core\Provider\WithRoutes; | ||
use LastDragon_ru\LaraASP\Core\Provider\WithTranslations; | ||
use Override; | ||
|
||
class PackageProvider extends ServiceProvider { | ||
use WithConfig; | ||
use WithRoutes; | ||
use WithTranslations; | ||
|
||
// <editor-fold desc="\Illuminate\Support\ServiceProvider"> | ||
// ========================================================================= | ||
#[Override] | ||
public function register(): void { | ||
parent::register(); | ||
|
||
$this->registerConfig(PackageConfig::class); | ||
} | ||
|
||
public function boot(): void { | ||
$this->bootTranslations(); | ||
$this->bootRoutes(function (): array { | ||
$config = $this->app->make(PackageConfig::class)->getInstance(); | ||
$settings = [ | ||
'enabled' => $config->routes->enabled, | ||
'attributes' => [ | ||
'prefix' => $config->routes->prefix, | ||
'middleware' => $config->routes->middleware, | ||
], | ||
]; | ||
|
||
return $settings; | ||
}); | ||
} | ||
// </editor-fold> | ||
|
||
// <editor-fold desc="Functions"> | ||
// ========================================================================= | ||
#[Override] | ||
protected function getName(): string { | ||
return Package::Name; | ||
} | ||
// </editor-fold> | ||
} |
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
File renamed without changes.
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
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