Answer the question
In order to leave comments, you need to log in
How to call the same queue every N seconds?
calling the queue
Route::get('/', function () {
$test = Test::find(1);
App\Jobs\ChangeTestNumber::dispatch()->delay(15);
});
public function handle()
{
$test = Test::find(1);
$test->number = rand(1,540);
$test->save();
}
public function handle()
{
$test = Test::find(1);
$test->number = rand(1,1000);
$test->save();
self::dispatch()->delay(20);
}
Let's add a new field to the user - experience We need to create a function in which:
The user will be retrieved and stored in the variable $user = User::find(1)
Next, the function displays experience
Parallel to the operation of the function The
asynchronous method changes the experience to a random number every few seconds
the first function is once again displayed after a period of time user experience. What will this conclusion be?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question