skip to Main Content

Laravel When Condition on a column

I have a ModelA with columns: name, last_name, email I want ModelA with the name Test to add an extra where on email what I tried is the following $model_a_res = A::when( function($query){ return $query->where('name','Test'); }, function ($query) { $query->where('email',…

VIEW QUESTION

Shopify – How to print Api response data as collection

I was trying to print API response data as collection on blade for that i have used following line $customers = collect(json_decode($response, true)); But whenever i tried to print with following code: @foreach($customers as $row) <tr> <td>{{$row->first_name}} {{$row->last_name}}</td> <td>{{$row->email}}</td> <td>{{$row->phone}}</td>…

VIEW QUESTION
Back To Top
Search