Skip to content

Commit cbe9c9a

Browse files
committed
add Laravel 11 Service Provider instructions to README.md
1 parent 5dd21bd commit cbe9c9a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ This package will auto-register its service provider.
6060
First, publish the package's files:
6161

6262
1. Publish the `CookiesServiceProvider` file: `php artisan vendor:publish --tag=laravel-cookie-consent-service-provider`
63-
2. Add the Service Provider to the `providers` array in `config/app.php`:
63+
2. Register the Service Provider in your application. For applications using Laravel 9 or 10, add the Service Provider to the `providers` array in `config/app.php`:
6464
```php
6565
'providers' => ServiceProvider::defaultProviders()->merge([
6666
// ...
@@ -69,6 +69,14 @@ First, publish the package's files:
6969
App\Providers\CookiesServiceProvider::class,
7070
])->toArray(),
7171
```
72+
73+
For applications running Laravel 11, add the Service Provider to the array in `bootstrap/providers.php`:
74+
```php
75+
return [
76+
App\Providers\AppServiceProvider::class,
77+
App\Providers\CookiesServiceProvider::class,
78+
];
79+
```
7280
3. Publish the configuration file: `php artisan vendor:publish --tag=laravel-cookie-consent-config`
7381

7482
If you want to customize the consent modal's views:

0 commit comments

Comments
 (0)