Hi, I was playing with editor and I wanted to count the number of row in a table, so I made this
function onStart(){
$this["invitati"] = DB::table('invitati')
->selectRaw('COUNT(*) as presenti')
->get();
}
and I want to print the value of invitati, but if I try to do
<div class="grid container">
<div class="col span-2"></div>
<div class="col span-10">
<p>{{ invitati }}</p>
</div>
</div>
It returns me: An exception has been thrown during the rendering of a template ("Array to string conversion").
The variable should contain the value "2", how can I print it?
Last updated