Level 1
Try this :
$countfails= Student::where('grade','fail')->count();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone. I have this table where Per subjects there will be grades, and I want to display how many of the students failed and pass, what is the eloquent code for this?
Please or to participate in this conversation.