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
Add support for dedicated eloquent builders and type/doc parameter support. (#1089)
* Add support for generating helpers for external eloquent builders
* Extract external builder methods generator to its own method and add an option to toggle this feature
* Check if we are using the default name of the eloquent builder
* Add tests with snapshots for external eloquent builder feature
* Refactor codegs
* Allow for type hinting
* Update test
* Run cs fix
* Update readme
* Use getName for parameter instead of relying on __toString()
* Do not use str_contains and use built in php method
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,6 +216,13 @@ You may use the [`::withCount`](https://laravel.com/docs/master/eloquent-relatio
216
216
217
217
By default, these attributes are generated in the phpdoc. You can turn them off by setting the config `write_model_relation_count_properties` to `false`.
218
218
219
+
#### Dedicated Eloquent Builder methods
220
+
221
+
A new method to the eloquent models was added called `newEloquentBuilder`[Reference](https://timacdonald.me/dedicated-eloquent-model-query-builders/) where we can
222
+
add support for creating a new dedicated class instead of using local scopes in the model itself.
223
+
224
+
If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_external_builder_methods` and setting it to `false`.
225
+
219
226
#### Unsupported or custom database types
220
227
221
228
Common column types (e.g. varchar, integer) are correctly mapped to PHP types (`string`, `int`).
0 commit comments