caresome/filament-auth-designer
Installation
composer require caresome/filament-auth-designer
Publish the config file:
php artisan vendor:publish --provider="Caresome\FilamentAuthDesigner\FilamentAuthDesignerServiceProvider" --tag="filament-auth-designer-config"
First Use Case
Add the package to your app/Providers/AppServiceProvider.php:
use Caresome\FilamentAuthDesigner\FilamentAuthDesigner;
public function boot(): void
{
FilamentAuthDesigner::make()
->media('public/images/auth-bg.jpg')
->position('right');
}
Where to Look First
config/filament-auth-designer.php (global defaults)app/Providers/AppServiceProvider.php (initial setup)resources/views/vendor/filament-auth-designer/ for customization pointsPer-Page Customization
Override defaults for specific auth pages (e.g., login, register) in AppServiceProvider:
FilamentAuthDesigner::make()
->forPage('login')
->media('public/images/login-bg.mp4')
->position('left')
->size('40%');
Dynamic Media Loading Use a closure to load media dynamically (e.g., based on user locale):
FilamentAuthDesigner::make()
->media(fn () => "public/images/{App::getLocale()}/auth-bg.jpg");
Theme Switching
Enable dark/light mode toggle in config/filament-auth-designer.php:
'theme' => [
'toggle' => true,
'dark' => [
'media' => 'public/images/dark-bg.jpg',
],
],
use Caresome\FilamentAuthDesigner\FilamentAuthDesignerPanel;
FilamentAuthDesignerPanel::make();
php artisan vendor:publish --tag="filament-auth-designer-views"
resources/css/filament-auth-designer.css:
.filament-auth-designer-cover {
@apply bg-gradient-to-r from-blue-500 to-purple-600;
}
Media Paths
public/ or use absolute URLs.storage_path('app/public/images/auth-bg.jpg') for local files, then symlink:
php artisan storage:link
Caching
php artisan filament:cache:clear
config/filament-auth-designer.php during development:
'cache' => false,
Video Auto-Play
muted attribute in config/filament-auth-designer.php:
'media' => [
'video' => [
'autoplay' => true,
'muted' => true,
],
],
filament-auth-designer::media) are firing.AppServiceProvider:
\Log::info('Auth Designer Config:', config('filament-auth-designer'));
Custom Hooks
Extend the package by adding new hooks in app/Providers/AppServiceProvider.php:
FilamentAuthDesigner::hook('after-media', function ($view) {
$view->with('customData', 'value');
});
Media Providers Register custom media sources (e.g., remote URLs, cloud storage):
FilamentAuthDesigner::extendMedia(function ($media) {
if (str_starts_with($media, 'https://')) {
return "custom-remote-media:{$media}";
}
return $media;
});
Theme Overrides Override default themes by publishing assets:
php artisan vendor:publish --tag="filament-auth-designer-themes"
Then modify resources/views/vendor/filament-auth-designer/themes/dark.blade.php.
FilamentAuthDesigner::make()
->media('public/images/auth-bg.jpg')
->size('50vh');
FilamentAuthDesigner::make()
->media('public/images/auth-bg.jpg')
->lazyLoad(true);
get() method to toggle configurations dynamically:
FilamentAuthDesigner::make()
->media(request()->get('ab_test') === 'new' ? 'new-bg.jpg' : 'old-bg.jpg');
How can I help you explore Laravel packages today?