skip to Main Content

Calling a schedule on a function in Laravel console.php

I want to call a function in console.php as a schedule. Here is my console.php code: <?php use AppHttpControllersAuctionController; use IlluminateSupportFacadesSchedule; Schedule::call(function () { ([AuctionController::class, 'endAuction']); echo 'Zakończono aukcję.'; })->everyTenSeconds(); Here is my function code: public function endAuction(Request $request, $id)…

VIEW QUESTION

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