Skip to content

Commit 56f7881

Browse files
committed
Tweaks docs for L11
1 parent c30ed24 commit 56f7881

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ php artisan tailwindcss:build --prod
128128

129129
### Preloading Assets as Link Header
130130

131-
If you want to preload the TailwindCSS asset, make sure to add the `AddLinkHeaderForPreloadedAssets` middleware to your `web` route group, such as:
131+
**For Laravel 10:**
132+
133+
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`:
132134

133135
```php
134136
<?php
@@ -155,6 +157,20 @@ class Kernel extends HttpKernel
155157
}
156158
```
157159

160+
**For Laravel 11:**
161+
162+
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`:
163+
164+
```php
165+
// ...
166+
->withMiddleware(function (Middleware $middleware) {
167+
$middleware->web(append: [
168+
\Tonysm\TailwindCss\Http\Middleware\AddLinkHeaderForPreloadedAssets::class,
169+
]);
170+
})
171+
// ...
172+
```
173+
158174
The package will preload the asset by default. If you're linking an asset like:
159175

160176
```blade

0 commit comments

Comments
 (0)