How do I get a "select count(*) group by" using laravel eloquent -


i execute follow sentence using laravel eloquent

select *, count(*) reserves  group day 

the solution occurs me create view in db, pretty sure there way in laravel way.

you use this:

$reserves = db::table('reserves')->selectraw('*, count(*)')->groupby('day'); 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -