V
V
Vladislav2018-05-29 17:25:06
Laravel
Vladislav, 2018-05-29 17:25:06

How to get the number of questions with a certain status?

You need to enter a number indicating the number of questions with the status "Published" and "Unanswered".
So far, it has only been possible to display the total number of questions in a category ({{$category->questions->count()}})
But how to get the number of questions that have a certain status?
www.prntscr.com/jo3jb7

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-05-29
@vos_50

$category->questions->where('колонка_статус, 'определенный статус')->count()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question