Filamentphp

FilamentPHP

If you develop an encapsulated Laravel/FilamentPHP package, i.e., with models, migrations, etc. included in your package.

You can use all these Laravel relevant parts via Bootraiser.

FilamentPHP PanelProvider

<?php
namespace DanHarrin\FilamentBlog;
 
use Filament\Panel;
use Filament\PanelProvider;
use Filefabrik\Bootraiser\Raiser;

class BlogPanelProvider extends PanelProvider
{
    // bootraiser typical
    public function register()
	{
	    parent::register();
	    // only if needed
		Raiser::forProvider($this)->loadConfigs();
	}
	// bootraiser typical
	public function boot(): void
    {
        Raiser::forProvider($this)->all();
    }
	// from filamentphp
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->id('blog')
            ->emailVerification()
            ->path('blog')
            ->resources([
                // ...
            ])
            ->pages([
                // ...
            ])
            ->widgets([
                // ...
            ])
            ->middleware([
                // ...
            ])
            ->authMiddleware([
                // ...
            ]);
    }
}
🌐
Use the PanelProvider suggested by FilamentPHP and add the bootraiser typical load and publish methods.

Your FilamentPHP package is now ready for delivery!

Structure

        • References

          https://filamentphp.com/docs/3.x/panels/plugins#distributing-a-panel-in-a-plugin

          Last updated on