Implement new config to specify return type of custom relations (#1300)

* Implement new config to specify return type of custom relations

* Apply suggestions from code review

Co-authored-by: Markus Podar <[email protected]>

* add test for morphed

* fix test output

* add info about how to add custom relationships

* fix wording

Co-authored-by: Markus Podar <[email protected]>
This commit is contained in:
Jefemy
2022-05-22 20:07:54 +02:00
committed by GitHub
co-authored by Markus Podar
parent a567f73140
commit ee9188acf1
10 changed files with 167 additions and 2 deletions
+13
View File
@@ -304,6 +304,19 @@ return [
*/
'additional_relation_types' => [],
/*
|--------------------------------------------------------------------------
| Additional relation return types
|--------------------------------------------------------------------------
|
| When using custom relation types its possible for the class name to not contain
| the proper return type of the relation. The key of the array is the relationship
| method name. The value of the array is the return type of the relation.
| e.g. `'relationName' => 'many'`.
|
*/
'additional_relation_return_types' => [],
/*
|--------------------------------------------------------------------------
| Run artisan commands after migrations to generate model helpers