Skip to content

Commit

Permalink
Made campaigns index page load much faster
Browse files Browse the repository at this point in the history
  • Loading branch information
Raikia authored and Raikia committed Jan 10, 2017
1 parent 741a6f4 commit 950fd23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CampaignController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct()

public function index()
{
$all_campaigns = Campaign::with('emails')->get();
$all_campaigns = Campaign::all();
return view('campaigns.index')->with('all_campaigns', $all_campaigns);
}

Expand Down
2 changes: 1 addition & 1 deletion resources/views/campaigns/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<td><a href="{{ action('CampaignController@campaign_details', ['id' => $camp->id ]) }}">{{ $camp->name }}</a></td>
<td>{{ $camp->description }}</td>
<td>{{ $camp->getStatus() }}</td>
<td>{{ $camp->emails()->where('status', \App\Email::SENT)->count() }} / {{ $camp->emails()->count() }} sent</td>
<td>{{ number_format($camp->emails()->where('status', \App\Email::SENT)->count()) }} / {{ number_format($camp->emails()->count()) }} sent</td>
<td>{{ $camp->created_at->format('M j, Y @ g:i:s a') }}</td>
<td>{{ $camp->updated_at->format('M j, Y @ g:i:s a') }}</td>
</tr>
Expand Down

0 comments on commit 950fd23

Please sign in to comment.