How to get the Laravel Query Builder to Output the Raw SQL Query?

|
Eng0sama_001 2022-03-02 01:54:45
laravel_discuss-110024.jpg
How to get data from table on relationship many to many use resource from table menu_item for data for offer table
not i use API .
ronitbose 2022-03-02 06:38:43
Does Any One Know Any Package To Add Google Authentication QR Code On Laravel/ui package??
ronitbose 2022-03-02 06:39:12
Because I didn’t Like Laravel jetstream/Brizze
nasrulhazim 2022-03-02 07:33:44
laravel passport?
Manalalsubaei 2022-03-02 07:36:53
laravel_discuss-110031.jpg
Hi every one.
It doesn’t work??
surajjdhv 2022-03-02 07:49:27
I think you want to use implode
surajjdhv 2022-03-02 07:49:50
You can use it directly after pluck helper
Shijinsubramanniam 2022-03-02 08:06:29
->orWhere(DB::raw(‘CONCAT_WS(name,” “, last_name)’), ‘like’, ‘%’ . $search_key . ‘%’)
Shijinsubramanniam 2022-03-02 08:06:53
Can anybody help me get concat result of two colums
Shijinsubramanniam 2022-03-02 08:07:18
The above query not working
udev21 2022-03-02 08:07:28
which db you are using ?
Shijinsubramanniam 2022-03-02 08:07:47
Mysqp
Shijinsubramanniam 2022-03-02 08:07:59
MySQL
udev21 2022-03-02 08:08:48
->orWhere(DB::raw(‘CONCAT(name,” “, last_name)’), ‘like’, ‘%’ . $search_key . ‘%’)
udev21 2022-03-02 08:09:18
udev21 2022-03-02 08:08:48
->orWhere(DB::raw(‘CONCAT(name,” “, last_name)’), ‘like’, ‘%’ . $search_key . ‘%’)

try this, concat and concat_ws are different functions

Shijinsubramanniam 2022-03-02 08:12:11
udev21 2022-03-02 08:08:48
->orWhere(DB::raw(‘CONCAT(name,” “, last_name)’), ‘like’, ‘%’ . $search_key . ‘%’)

I put this

Shijinsubramanniam 2022-03-02 08:12:22
But no result found
udev21 2022-03-02 08:14:46
Shijinsubramanniam 2022-03-02 08:12:22
But no result found

it depends on stored values for name and last_name on your table

Shijinsubramanniam 2022-03-02 08:15:05
udev21 2022-03-02 08:14:46
it depends on stored values for name and last_name on your table

I have values

Shijinsubramanniam 2022-03-02 08:15:25
And am getting result when a single column is used
Shijinsubramanniam 2022-03-02 08:16:01
$query->orWhere(‘name’, ‘like’, ‘%’ . $search_key . ‘%’)
->orWhere(‘last_name’, ‘like’, ‘%’ . $search_key . ‘%’)
->orWhere(DB::raw(‘CONCAT(name,” “, last_name)’), ‘like’, ‘%’ . $search_key . ‘%’)
udev21 2022-03-02 08:16:45
try debug query with function toSql()
Shijinsubramanniam 2022-03-02 08:17:33
I don’t understand that
Shijinsubramanniam 2022-03-02 08:17:43
Can u please explain
Shijinsubramanniam 2022-03-02 08:17:53
Iam noobie
udev21 2022-03-02 08:18:26
https://devdojo.com/bobbyiliev/how-to-get-the-laravel-query-builder-to-output-the-raw-sql-query

How to get the Laravel Query Builder to Output the Raw SQL Query?DevDojo
Introduction The Eloquent ORM included with Laravel provides you with an easy way of interacting with your database. This simplifies all CRUD (Create, read, update, and delete) operations and any othe…
Shijinsubramanniam 2022-03-02 08:30:57
By using tosql
Shijinsubramanniam 2022-03-02 08:31:10
Iam getting database error
Amit Sharma 2022-03-02 10:07:37
anyone please help
Amit Sharma 2022-03-02 10:07:50
{“message”:”The given data was invalid.”,”errors”:{“name”:[“The name field is required.”],”email”:[“The email field is required.”],”mobile”:[“The mobile field is required.”],”address”:[“The address field is required.”],”dob”:[“The dob field is required.”],”place”:[“The place field is required.”],”time”:[“The time field is required.”]}}
Amit Sharma 2022-03-02 10:08:05
i have these errors in my console
Amit Sharma 2022-03-02 10:08:16
how to show it in blade file
Amit Sharma 2022-03-02 10:08:27
pls anyone ?
mazcvei 2022-03-02 10:09:53
Amit Sharma 2022-03-02 10:08:27
pls anyone ?

Read the doc, errors

WellyRosadi 2022-03-02 10:10:27
Amit Sharma 2022-03-02 10:08:16
how to show it in blade file

https://laravel.com/docs/9.x/validation#retrieving-all-error-messages-for-a-field

Laravel – The PHP Framework For Web ArtisansLaravel
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
|