-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#38 - Extend eloquent tools #42
Conversation
src/Features/Traits/Eloquent.php
Outdated
{ | ||
$modelClass = $this->recognizeModelClass($model); | ||
$attributes = $table ? $table->getRowsHash() : []; | ||
|
||
$modelClass::factory()->create($attributes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add creating for models without factory?
src/Features/Traits/Eloquent.php
Outdated
"The model $model1 does not have a $relation relation method.", | ||
); | ||
|
||
LaravelRelations::assertRelation($instance, $relation, 'Illuminate\Database\Eloquent\Relations\HasMany'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at this file: https://github.com/blumilksoftware/blt/blob/main/src/LaravelContracts.php and try to replicate its purpose here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, i think
This PR adds new functions to the eloquent trait.
This should close #38