Skip to content

Commit 558046e

Browse files
Merge pull request #21 from verbanent/update/readme-after-config
Added details about library config in README.md
2 parents fb52b1e + a62a4f5 commit 558046e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,37 @@ More scenarios are documented in the `examples/` directory:
107107
- `examples/04-creating-entities-with-string-uuid.md`
108108
- `examples/05-querying.md`
109109

110+
## Configuration
111+
112+
If you want a global default UUID column name, publish the config and set the
113+
environment variable.
114+
115+
1. Publish the config file:
116+
117+
```bash
118+
php artisan vendor:publish --provider="Verbanent\\Uuid\\Providers\\BinaryUuidServiceProvider" --tag=binary-uuid-config
119+
```
120+
121+
2. Set the default column name in `.env`:
122+
123+
```
124+
BINARY_UUID_DEFAULT_COLUMN=uuid
125+
```
126+
127+
3. Refresh config:
128+
129+
```bash
130+
php artisan config:clear
131+
# or
132+
php artisan config:cache
133+
```
134+
135+
Per-model override still works and takes precedence:
136+
137+
```php
138+
protected $uuidColumn = 'custom_uuid';
139+
```
140+
110141
## Unit tests
111142

112143
Run this command if you want to check unit tests:

0 commit comments

Comments
 (0)