Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

can we use 2 select in a query laravel

$myTable = MyTable->select('firstField');

if ($somethingTrue) {
    $myTable->addSelect('secondField');
}

if ($somethingElseTrue) {
    $myTable->addSelect('thirdField');
}

$myTable->get();
Source by coreui.io #
 
PREVIOUS NEXT
Tagged: #select #query #laravel
ADD COMMENT
Topic
Name
4+6 =