Skip to content

Commit 3f4de65

Browse files
committed
docs: update important note for service provider registration
1 parent 1dc01bc commit 3f4de65

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ Service Interface .............. App\Services\User\UserServiceInterface
5656
Service Implementation ......... App\Services\User\UserService
5757
```
5858

59-
### Register Service Providers
59+
## Important Note: Service Provider Registration
60+
61+
The service provider registration depends on your Laravel version and configuration:
62+
63+
### For Provider Binding Mode (Default - Works well on all Laravel versions)
64+
65+
If your `config/repository.php` has `'binding_mode' => 'provider'` (default), you **must** register the service providers.
6066

6167
Add the generated service providers to your `bootstrap/providers.php` (only once after running the first make repository command):
6268

@@ -72,6 +78,19 @@ return [
7278
];
7379
```
7480

81+
### For Attribute Binding Mode (Laravel >= 12)
82+
83+
If your `config/repository.php` has `'binding_mode' => 'attribute'` and you're using **Laravel 12+**, you can skip the service provider registration entirely. The package will automatically register bindings using PHP attributes.
84+
85+
**Configuration Example:**
86+
```php
87+
// config/repository.php
88+
return [
89+
'binding_mode' => 'attribute', // Change to 'attribute' for Laravel 12+
90+
// ... other config
91+
];
92+
```
93+
7594
## Usage
7695
### Controller Integration
7796

0 commit comments

Comments
 (0)