Laravel Whereraw Not Working

Submitted by pakainfo - 4 years ago

Laravel is a web application framework with expressive, elegant syntax.The PHP Framework for Web Artisans,freeing you to create without sweating the small things. CRUD Operation With Server Side.

Laravel db raw where clause example: 1) DB::raw()

$members = \DB::table("members")
        ->where(DB::raw("(DATE_FORMAT(created_at,'%d-%m-%Y'))"),'19-01-2022')
        ->get();
dd($members);

2) whereRaw()

$members = \DB::table("members")
        ->whereRaw("DATE_FORMAT(created_at,'%d-%m-%Y') = '19-01-2022'")
        ->get();
dd($members);

More Example Read..... :  https://www.pakainfo.com/laravel-whereraw-not-working/