duplicate query
This commit is contained in:
parent
3a97c98797
commit
7b9c9e8403
@ -24,7 +24,7 @@ class Companies extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$companies = Company::collect();
|
$companies = user()->companies()->collect();
|
||||||
|
|
||||||
return $this->response('common.companies.index', compact('companies'));
|
return $this->response('common.companies.index', compact('companies'));
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ class Company extends Eloquent
|
|||||||
|
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
|
|
||||||
$query = user()->companies()->usingSearchString($search)->sortable($sort);
|
$query->usingSearchString($search)->sortable($sort);
|
||||||
|
|
||||||
if ($request->expectsJson() && $request->isNotApi()) {
|
if ($request->expectsJson() && $request->isNotApi()) {
|
||||||
return $query->get();
|
return $query->get();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user