Search
 
SCRIPT & CODE EXAMPLE
 

PHP

case inside laravel query

DB::table('ref')->select(['id','name',DB::raw('(case when (id > 17) then "yes" else "no" end) as present')])->get();
Comment

PREVIOUS NEXT
Code Example
Php :: laravel group by on subquery 
Php :: loop object property laravel 
Php :: php hash password 
Php :: nl2br php 
Php :: laravel 8 date difference in days 
Php :: object values to array php 
Php :: laravel load view in variable 
Php :: setcookie 
Php :: Array and string offset access syntax with curly braces is deprecated in tcpdf.php 
Php :: foreignid in laravel 
Php :: how to add script in WordPress admin page 
Php :: how to check if there is an authenticated user laravel 
Php :: php 2d empty array remove 
Php :: laravel where like 
Php :: wordpress notice 
Php :: laravel seed fresh 
Php :: add to collection laravel 
Php :: check type in php 
Php :: php month single digit 
Php :: api anaf 
Php :: laravel-socialite-invalidstateexception 
Php :: carbon months between dates 
Php :: select sql in php 
Php :: minus 1 year php 
Php :: laravel eloquent to array key value 
Php :: linux delete php sessions 
Php :: php counter 
Php :: blade condition if else laravel 
Php :: add 1 day php datetime 
Php :: eloquent whereraw 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =