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
Back To Top
Search