bestmomo / laravel5-example

Simple laravel5 example for tutorial
MIT License
1.2k stars 568 forks source link

update BaseRepository to improve the count number #17

Closed zhuzhichao closed 9 years ago

zhuzhichao commented 9 years ago

$this->model->count(); SQL: SELECT count(*) as aggregate FROM "comments"

$this->model->all()->count(); SQL: SELECT * FROM "comments";

bestmomo commented 9 years ago

For a strange reason this wasn't working on L5 prerelease but now it's ok.