### Install tapp/filament-invite Package Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Installs the tapp/filament-invite package using Composer. Ensure you specify the desired version constraint for compatibility. ```bash composer require tapp/filament-invite:"^2.0" ``` -------------------------------- ### Install Filament Invite Package and Publish Configuration Source: https://context7.com/tappnetwork/filament-invite/llms.txt Installs the Filament Invite package using Composer and publishes its configuration file using Artisan. This is the initial setup step for integrating the package into a Laravel project. ```bash composer require tapp/filament-invite:"^2.0" php artisan filament-invite:install ``` -------------------------------- ### Implement User Model for Filament Invite Source: https://context7.com/tappnetwork/filament-invite/llms.txt Ensure your User model implements Laravel's `CanResetPassword` and `MustVerifyEmail` interfaces, and Filament's `FilamentUser` contract. This example demonstrates a fully configured User model, including optional methods for customizing the password reset URL and sending the password set notification, ensuring compatibility with Filament Invite. ```php 'datetime', 'password' => 'hashed', ]; public function canAccessPanel(Panel $panel): bool { return true; } // Optional: Custom reset URL for Filament public function getResetPasswordUrl(string $token, array $parameters = []): string { return URL::signedRoute( 'filament.admin.auth.password-reset.reset', [ 'email' => $this->email, 'token' => $token, ...$parameters, ], ); } // Optional: Custom notification public function sendPasswordSetNotification($token) { $this->notify(new \Tapp\FilamentInvite\Notifications\SetPassword($token)); } } ``` -------------------------------- ### Publish Filament Invite Configuration Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Publishes the configuration file for the filament-invite package using the Artisan command. This allows for customization of package behavior. ```bash php artisan filament-invite:install ``` -------------------------------- ### Run Package Tests Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Executes the test suite for the tapp/filament-invite package using Composer. This is a standard command for verifying package integrity. ```bash composer test ``` -------------------------------- ### Add Invite Action to Filament Table Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Demonstrates how to add the InviteAction to the record actions of a Filament table. This makes the invite functionality available for each record in the table. ```php public static function table(Table $table): Table { return $table ->recordActions([ \Tapp\FilamentInvite\Actions\InviteAction::make(), ]); } ``` -------------------------------- ### Add Invite Action to Filament Header Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Shows how to add the InviteAction to the header actions of a Filament resource. This provides a global invite action accessible from the resource's main page. ```php protected function getHeaderActions(): array { return [ \Tapp\FilamentInvite\Actions\InviteAction::make(), ]; } ``` -------------------------------- ### Configure Filament Invite Package Settings Source: https://context7.com/tappnetwork/filament-invite/llms.txt Configure the Filament Invite package by modifying the `config/filament-invite.php` file. Key options include setting the token expiration time in minutes and defining the named route for password resets. This configuration allows for fine-tuning the invitation and password reset process. ```php 60 * 24 * 2, // Route configuration 'routes' => [ // The named route for password reset 'reset' => 'password.reset', ], ]; ``` -------------------------------- ### Implement User Model Reset Password URL Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Customizes the password reset URL by implementing the getResetPasswordUrl method on the user model. This method should return a signed route for password resetting. ```php public function getResetPasswordUrl(string $token, array $parameters = []): string { return URL::signedRoute( 'filament.admin.auth.password-reset.reset', [ 'email' => $this->email, 'token' => $token, ...$parameters, ], ); } ``` -------------------------------- ### Implement User Model Password Set Notification Source: https://github.com/tappnetwork/filament-invite/blob/2.x/README.md Defines how the password set notification is sent by implementing the sendPasswordSetNotification method on the user model. It uses Laravel's Notification system. ```php public function sendPasswordSetNotification($token) { Notification::send($this, new SetPassword($token)); } ``` -------------------------------- ### Customize SetPassword Notification Email Content Source: https://context7.com/tappnetwork/filament-invite/llms.txt Customize the email content for the SetPassword notification using the static `toMailUsing` method. This method accepts a callback that receives the notifiable user and token, allowing for dynamic email generation without creating a custom notification class. Dependencies include Laravel's `MailMessage` class. ```php subject('Welcome to Our Platform!') ->greeting('Hello ' . $notifiable->name . '!') ->line('You have been invited to join our platform.') ->line('Please click the button below to set your password and activate your account.') ->action('Set Your Password', $notifiable->getResetPasswordUrl($token)) ->line('This link will expire in 48 hours.') ->salutation('Best regards, The Team'); }); ``` -------------------------------- ### Customize Password Set Notification in User Model Source: https://context7.com/tappnetwork/filament-invite/llms.txt Overrides the `sendPasswordSetNotification` method in the User model to utilize a custom notification class for invitation emails. This allows for tailored email content, subjects, and additional logic. ```php $this->email, 'token' => $token, ...$parameters, ], ); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.