Installation:
composer require stephenjude/filament-jetstream
php artisan filament-jetstream:install
Publish Assets:
npm install && npm run dev
npm run build
First Use Case:
/login to test authentication./register./admin (default credentials: admin@example.com/password).config/filament-jetstream.php (customize branding, auth defaults).App\Providers\FilamentJetstreamServiceProvider.php (extend functionality).resources/views/vendor/filament-jetstream/ (override templates).database/migrations/ (customize user/team tables).Authentication Flows:
FilamentJetstream\Providers\AuthServiceProvider to add custom validation.FilamentJetstream\TwoFactorAuthenticatable trait for user models.FilamentJetstream\PasswordResetService for custom logic.Team Management:
FilamentJetstream\TeamInvitation model for custom fields.spatie/laravel-permission.API Tokens:
/admin/personal-access-tokens.Profile Management:
FilamentJetstream\Profile resource by publishing views:
php artisan vendor:publish --tag="filament-jetstream-views"
AppServiceProvider:
Filament::registerPanel(
FilamentJetstreamPanel::make()
->id('admin')
->path('admin')
->login()
->registration()
->passwordReset()
->emailVerification()
->twoFactorAuthentication()
->profileManagement()
->teams()
);
filament/inertia for SPA integration. Example:
// resources/js/Pages/Admin/Profile.jsx
import { Head, router } from '@inertiajs/react';
import FilamentProfile from 'filament-jetstream/resources/js/Pages/Profile';
FilamentJetstreamTesting trait for auth tests:
use FilamentJetstream\Testing\FilamentJetstreamTesting;
public function test_login()
{
$this->actingAsUser(factory(User::class)->create())
->get('/admin')
->assertSuccessful();
}
Asset Conflicts:
filament/support and filament/filament are up-to-date. Run:
composer update filament/support filament/filament
php artisan view:clear
Team Support Quirks:
App\Models\User uses FilamentJetstream\HasTeams trait.php artisan vendor:publish --tag="filament-jetstream-migrations"
2FA Edge Cases:
FilamentJetstream\TwoFactorAuthenticatable to log failed attempts:
protected function failedTwoFactorAttempt()
{
event(new TwoFactorFailed($this));
}
Session Management:
filament/support for auth middleware.config/filament.php:
'logging' => true,
@debug to Filament views to inspect data:
@debug(auth()->user())
tinker to inspect Jetstream models:
php artisan tinker
>>> $user = App\Models\User::first();
>>> $user->teams
Custom Fields:
Profile resource via service provider:
FilamentJetstream::profileResource(function (ProfileResource $resource) {
$resource->addFields([
TextInput::make('custom_field')->columnSpanFull(),
]);
});
Notifications:
FilamentJetstream\Notifications\TwoFactorAuthenticationNotification for custom emails.API Endpoints:
Filament::registerApiResources([
ApiPersonalAccessTokenResource::class,
]);
Dark Mode:
config/filament.php:
'dark_mode' => true,
php artisan vendor:publish --tag="filament-jetstream-lang"
filament-jetstream.php:
'features' => [
'teams' => false,
],
.github/workflows/tests.yml:
- run: php artisan test --filter=FilamentJetstreamTests
How can I help you explore Laravel packages today?