PHP code example of filefabrik / bootraiser

1. Go to this page and download the library: Download filefabrik/bootraiser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

filefabrik / bootraiser example snippets




namespace YourCompanyVendor\YourPackage\Providers;

use Filefabrik\Bootraiser\WithBootraiser;
use Illuminate\Support\ServiceProvider;

class YourPackageServiceProvider extends ServiceProvider
{
    // insert this Magic Trait :)
    use WithBootraiser;

    public function register()
    {
        $this->bootraiserRegister('Config');
    }

    public function boot(): void
    {
       // parts to boot if they are already exists in your code 
       $bootParts = [
            'Seeders',
       	    'Routes',
			'Migrations',
			'Translations',
			'Views',
			'Commands',
            // 3rd Party package
			'Livewire',
		];
 
        /* Easy boot utility. You can replace all the booted service/parts with your own*/
       $this->bootraiserBoot($bootParts);
    }

}

 
...
public function boot(): void
    {
       
       // parts to boot if they are already exists in your code 
       $bootParts = [
            'Seeders',
       	    'Routes',   
       	    'Migrations',   
       	    'Translations',
		];
 
        /* Easy boot utility. You can replace all the booted service/parts with your own*/
       $this->bootraiserBoot($bootParts);
       
       /**
        * your custom boot stuff
        */
       
       // boot the rest if need 
       $bootParts2 = [
            'Views',
            'Commands',
            // 3rd Party package
            'Livewire',
            ];
       $this->bootraiserBoot($bootParts2);
    }
...

 public function register(){
    $this->bootraiserIntegrate('Migrations')
 }

 
...
$this->bootraiserPackage()->setGroupName('cooler');



namespace YourCompanyVendor\YourPackage\Providers;

use Filefabrik\Bootraiser\WithBootraiser;
use Illuminate\Support\ServiceProvider;

class YourPackageServiceProvider extends ServiceProvider
{
    // insert this Magic Trait :)
    use WithBootraiser;    
    
    // 
    public function register()
    {
        $this->bootraiserRegister(['Config']);
    }

    public function boot(): void
    {
       // parts to boot if they are already exists in your code 
        // parts to boot if they are already exists in your code 
       $bootParts = [   
            'Seeders',
       	    'Routes',   
       	    'Migrations',   
       	    'Translations',
		];
 
        /* Easy boot utility. You can replace all the booted service/parts with your own*/
       $this->bootraiserBoot($bootParts);
       
       /**
        * your custom boot stuff
        */
       
       // boot the rest if need 
       $bootParts2 = [
            'Views',
            'Commands',
            // 3rd Party package
            'Livewire',
            ];
       $this->bootraiserBoot($bootParts2);
    }

}



namespace Filefabrik\BootraiserDemo\Providers;

use Filefabrik\Bootraiser\WithBootraiserEvent;
use Illuminate\Foundation\Support\Providers\EventServiceProvider;

class BootraiserDemoEventServiceProvider extends EventServiceProvider
{
    // Magic for Events
    use WithBootraiserEvent;

    public function register()
    {
        // call parent::register() is mandatory!
        parent::register();
        $this->bootraiserRegister('Config','Events');
    }
}

shell
php artisan vendor:publish --tag=cooler-views
shell
php artisan bootraiser:seed
shell
php artisan bootraiser:show {packagename}