andersao / andersao/l5-repository

How to get relation data with repository

Open
#557 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
4.2k
Forks
880
PR merge metrics
No merged PRs in 30d

Description

This is the query
```
SELECT
employees.emp_name,
companies.company_name ,
companies.company_address
FROM
employees
INNER JOIN companies ON employees.company_id = companies.company_id
```
and I tried with scopeQuery. It doesn't give output. what i expected.
```
$this->repository->scopeQuery(function ($query) {
return $query->join('companies', 'companies.company_id', '=', 'employees.company_id');
})->all();
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.