Skip to content

Commit

Permalink
fixed #33
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Oct 3, 2017
1 parent 201ceea commit 88e62a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Companies/Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Companies extends Controller
*/
public function index()
{
$companies = Auth::user()->companies()->collect();
$companies = Company::collect();

foreach ($companies as $company) {
$company->setSettings();
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Company/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Models\Company;

use Auth;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\SoftDeletes;
Expand Down Expand Up @@ -194,7 +195,7 @@ public function scopeCollect($query, $sort = 'name')
$input = $request->input();
$limit = $request->get('limit', setting('general.list_limit', '25'));

return $this->filter($input)->sortable($sort)->paginate($limit);
return Auth::user()->companies()->filter($input)->sortable($sort)->paginate($limit);
}

/**
Expand Down

0 comments on commit 88e62a8

Please sign in to comment.