Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk authored Feb 28, 2025
1 parent 4004d53 commit b4d46e5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,26 @@ Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-mails-views"
```

Add the routes to your `web.php` file:
Add the routes to your `routes/web.php` file:

```php
use Vormkracht10\FilamentMails\Facades\FilamentMails;

// Basic usage - uses default Filament panel path and name
FilamentMails::routes();

// Prefix routes with path and/or name
FilamentMails::routes(
path: 'panel-path',
name: 'panel-id'
);
```

> [!NOTE]
> By default, the path will be set to your Filament panel's path and the name will be 'filament.' followed by your panel's ID. You only need to customize these if you want different values.
Or add them to your PanelProvider using the `routes()` method, like this:

```php
use Vormkracht10\FilamentMails\FilamentMailsPlugin;

public function panel(Panel $panel): Panel
{
return $panel
->routes(Filament::routes());
}
```

Then add the plugin to your `PanelProvider`

Expand All @@ -91,7 +94,7 @@ public function panel(Panel $panel): Panel
}
```

### Tenant middleware / route protection
### Tenant middleware and route protection

If you want to protect the mail routes with your (tenant) middleware, you can do so by adding the routes to the `tenantRoutes`:

Expand Down

0 comments on commit b4d46e5

Please sign in to comment.