Closed coaradsupp closed 4 years ago
What's the result of dd(Reserve::find(43)->getAttributes(), Reserve::find(43)->worktime->getAttributes());
?
thank you for your response
this result
I'll look into it.
What version of the package are you using (composer show
)?
What's the result of this snippet?
\DB::enableQueryLog();
Reserve::find(43)->load('office');
dd(\DB::getQueryLog());
this version : "staudenmeir/eloquent-has-many-deep": "^1.7",
10 instead 43
\DB::enableQueryLog();
Reserve::find(10)->load('office');
dd(\DB::getQueryLog());
return this result:
What does composer show
show for staudenmeir/eloquent-has-many-deep
?
What's your Laravel version?
staudenmeir/eloquent-has-many-deep v1.7 Laravel Eloquent HasManyThrough relationship with unlimited levels
laravel/framework v5.6.39 The Laravel Framework.
This is/was a Laravel issue and has been fixed in Laravel 5.8.
If you can't upgrade, you can use one of my other packages: https://github.com/staudenmeir/belongs-to-through
class Reserve extends Model
{
use \Znck\Eloquent\Traits\BelongsToThrough;
public function office()
{
return $this->belongsToThrough(Office::class, Worktime::class);
}
}
Thanks for your good and complete answers
so use this package
hi, tnx for this package i use this format for better explaine:
in this relation
$reserve = Reserve::find(43); dd($reserve->load('office'));
id of office wrong worktime_id set to office id
how solve this problem?????