Commit 5f856a0b6c4b1cccd26d8ad16044378072bab7a0
1 parent
12f7faf68d
Exists in
master
fix show count ads on company page
Showing 2 changed files with 6 additions and 5 deletions Side-by-side Diff
app/Http/Controllers/CompanyController.php
... | ... | @@ -63,10 +63,11 @@ class CompanyController extends Controller |
63 | 63 | ->where('employer_id', '=', $company[0]->id) |
64 | 64 | ->where('is_remove', '=', '0') |
65 | 65 | ->where('active_is', 1) |
66 | - ->OrderByDesc('id') | |
67 | - ->paginate(50) | |
68 | - ; | |
66 | + ->OrderByDesc('id'); | |
69 | 67 | |
70 | - return view('info_company_new', compact('company', 'user_id', 'title', 'ads')); | |
68 | + $countAds = $ads->count(); | |
69 | + $ads = $ads->paginate(50); | |
70 | + | |
71 | + return view('info_company_new', compact('company', 'user_id', 'title', 'ads', 'countAds')); | |
71 | 72 | } |
72 | 73 | } |
resources/views/info_company_new.blade.php