Using example on the Laravel Has Many Through docs
projects
id - integer
name - string
environments
id - integer
project_id - integer
name - string
deployments
id - integer
environment_id - integer
commit_hash - string
public function index(ProjectFilters $filters)
{
$results = $project->deployments()->filter($filters);
// On the results, the id of environments will override the id of the deployments
}
This is because HasManyThrough class overrides the get() call on the Relation class.
Using example on the Laravel Has Many Through docs
projects id - integer name - string
environments id - integer project_id - integer name - string
deployments id - integer environment_id - integer commit_hash - string
This is because HasManyThrough class overrides the
get()
call on the Relation class.