Skip to content

Commit

Permalink
Tweaks docs for L11
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Mar 6, 2024
1 parent c30ed24 commit 56f7881
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ php artisan tailwindcss:build --prod

### Preloading Assets as Link Header

If you want to preload the TailwindCSS asset, make sure to add the `AddLinkHeaderForPreloadedAssets` middleware to your `web` route group, such as:
**For Laravel 10:**

If you want to preload the TailwindCSS asset on Laravel 10, add the `AddLinkHeaderForPreloadedAssets` middleware to your `web` route group in the `app/Http/Kernel.php`:

```php
<?php
Expand All @@ -155,6 +157,20 @@ class Kernel extends HttpKernel
}
```

**For Laravel 11:**

If you want to preload the TailwindCSS asset on Laravel 11, add the `AddLinkHeaderForPreloadedAssets` middleware to your `web` route group in the `bootstrap/app.php`:

```php
// ...
->withMiddleware(function (Middleware $middleware) {
$middleware->web(append: [
\Tonysm\TailwindCss\Http\Middleware\AddLinkHeaderForPreloadedAssets::class,
]);
})
// ...
```

The package will preload the asset by default. If you're linking an asset like:

```blade
Expand Down

0 comments on commit 56f7881

Please sign in to comment.