Support the ongoing development of Laravel.io →
posted 10 years ago
Queues
Last updated 2 years ago.
0
echo $count
Last updated 2 years ago.
0

Isnt just :

$count = DB::table('fixtures')->where('someid', '=', $id)->count();

echo $count;

?? :)

Last updated 2 years ago.
0

The first code is in your controller class? You can do that in the controller class and then return the variable to the view, like this:

$count = DB::table('fixtures')->where('someid', '=', $id)->count();

return View::make('view/path')->with('count', $count);

And in your view call the variable

$count
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Silver89 silver89 Joined 7 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.