From b4d46e5bea2da2fa80d424dc7ca95147f89d411e Mon Sep 17 00:00:00 2001 From: Mark van Eijk Date: Fri, 28 Feb 2025 21:24:10 +0100 Subject: [PATCH] Update README.md --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e744e41..289efec 100644 --- a/README.md +++ b/README.md @@ -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` @@ -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`: