Bootraiser
- Use Bootraiser fully for all your Laravel Loading/Publishing Stuff or selective.
- Each Package with Bootraiser controls itself and can be individually configured.
The complete list of Laravel components that bootraiser supports automatically loadable or publishable can be found here
Bootraiser expects in custom packages the typical Laravel Directory-Structure
via Methods
use Filefabrik\Bootraiser\Raiser;
public function register()
{
parent::register();
Raiser::forProvider($this)->loadConfigs();
}
public function boot(): void
{
Raiser::forProvider($this)
->publishConfigs()
->Migrations()
->Routes()
->Translations()
->Views()
->Components()
->Commands()
->Livewire()
;
}
From config/array
If you want to make the boot process configurable for your package, use the Laravel Config mechanism, for example.
Here you are free to design the configuration for your boot process.
If you use the laravel-config mechanism, make sure that the config is loaded in the “register” method.
Typical package configuration file
~/packages/your-package/config/your-package.php
Create boot config
In your package config file, write a “bootraiser” key with bootable aspects you want to use
./config/your-package.php
<?php
// your typical laravel package config
return [
'some other configs'=>'with some values',
'bootraiser' => [
'publishConfigs',
'Views',
'Migrations',
'loadRoutes',
'publishRoutes',
'Translations',
'Views',
'Components',
'Commands',
'Assets',
'Livewire',
],
];
?>
Fix Service Provider
<?php
use Filefabrik\Bootraiser\Raiser;
public function register()
{
parent::register();
Raiser::forProvider($this)->loadConfigs();
}
public function boot(): void
{
Raiser::forProvider($this)->runFromArray(config('your-package.bootraiser'));
}
?>
Note: while using the package config file to configure the booting process, make sure you have the register
method
called before in this way.