You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Laravel utility to keep records synced between enviroments through source contro
6
6
- Create a JSON file for each model, using the model name as the filename. Example: Product.json would update the Product model
7
7
- Use nested arrays in place of hardcoded IDs for relationships
8
8
- Run `php artisan vendor:publish --provider="distinctm\LaravelDataSync\DataSyncBaseServiceProvider" --tag="data-sync-config"` to publish config file. Specify directory for sync data files (default is a new sync directory in the project root)
9
-
- Run `php artisan data:sync`
9
+
- Run `php artisan data:sync` (or `php artisan data:sync --model={model}` with the model flag to specify a model)
10
10
11
11
### Optional
12
12
If using Laravel Forge, you can have the data sync run automatically on deploy. Edit your deploy script in Site -> App to include:
@@ -21,8 +21,18 @@ fi
21
21
## Notes
22
22
- use studly case for model name relationships as JSON keys (example: 'option_group' => 'OptionGroup'). This is important for case sensitive file systems.
23
23
- empty values are skipped
24
-
- the criteria/attributes for updateOrCreate are identified with a preleading underscore
24
+
- the criteria/attributes for updateOrCreate are identified with a leading underscore
25
25
- nested values represent relationships and are returned using where($key, $value)->first()->id
26
+
- order of import can be set in _config/data-sync.php_ with an array:
0 commit comments