Answer the question
In order to leave comments, you need to log in
What is the correct way to use a raw expression for a query?
Good afternoon, ladies and gentlemen.
Actually, I would like to ask.
How would you implement a raw table query expression? (Laravel)
In my case there is a table. And it has n number of entries.
What is the correct way to use the query builder to display the number of records in a table without creating possible SQL injection points?
I'm trying to do according to the documentation:
Swears at
Call to undefined method Illuminate\Database\Query\Builder::table()
$loler = Kyrpost::table('kyrposts')
->select(Kyrpost::raw('count(*) from kyrposts'))
->get();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question