Home

Awesome

<p align="center"> <img src="https://user-images.githubusercontent.com/41773797/131910226-676cb28a-332d-4162-a6a8-136a93d5a70f.png" alt="Banner" style="width: 100%; max-width: 800px;" /> </p>

A custom package for Filament with login flow, profile and teams support.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The missing toolkit from Filament Admin with Breeze-like functionality. Includes login, registration, password reset, password confirmation, email verification, and a my profile page. All using the TALL-stack, all very Filament-y.

Screenshots

Screenshot of Login Screenshot of Profile Screenshot of Register Screenshot of Reset Screenshot of Reset

Installation

  1. Install the package via composer:
composer require jeffgreco13/filament-breezy
  1. Update the config/filament.php to point to the Breezy Login::class.
"auth" => [
    "guard" => env("FILAMENT_AUTH_GUARD", "web"),
    "pages" => [
        "login" =>
            \JeffGreco13\FilamentBreezy\Http\Livewire\Auth\Login::class,
    ],
],

Optionally, you can publish the Breezy config file for further customizations, such as Password rules, redirect after registration, and enable/disable the profile page.

php artisan vendor:publish --tag="filament-breezy-config"

Optionally, you can publish the views using:

php artisan vendor:publish --tag="filament-breezy-views"

Usage

Email Verification

Uses the Laravel Email Verification service. Implement MustVerifyEmail on your User model:

use Illuminate\Contracts\Auth\MustVerifyEmail;

class User extends Authenticatable implements MustVerifyEmail

Then you can add the verified middleware to any of your routes:

Route::get("/profile", function () {
    // Only verified users may access this route...
})->middleware("verified");

Or, force verified emails on your entire Filament Admin by adding the EnsureEmailIsVerified class to the auth middleware in config/filament.php:

"middleware" => [
    "auth" => [
        Authenticate::class,
        Illuminate\Auth\Middleware\EnsureEmailIsVerified::class
    ],
    ....

Extending and Overriding Components

All pages within the auth flow are full-page Livewire components made to work with Filament Forms. So you can easily extend any component to add your own fields and actions:


use JeffGreco13\FilamentBreezy\Http\Livewire\Auth\Register as FilamentBreezyRegister;

class Register extends FilamentBreezyRegister
{

    protected function getFormSchema(): array
    {
        return array_merge(parent::getFormSchema(),[
            Forms\Components\Checkbox::make('consent_to_terms')->label('I consent to the terms of service and privacy policy.')->required()
        ]);
    }

    protected function getPreparedData($data): array
    {
        $preparedData = parent::getPreparedData($data);
        $preparedData['consent_to_terms'] = $data['consent_to_terms'];

        return $preparedData;
    }
...

Flash Notifications

The Breezy auth layouts use the <x-filament::notification> component to flash messages to the page. Flash messages in the same way as you would with $this->notify() but instead flash to the session:

session()->flash("notify", [
    "status" => "success",
    "message" => "Check your inbox for instructions.",
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.