fyaren liked a comment+100 XP
1w ago
You can run php artisan schedule:work. This is a long running task and will process the schedule every minute.
Its designed to give the same effect as cron job in a local environment.
fyaren liked a comment+100 XP
4mos ago
Old topic but maybe useful for someone : you can simply queue a whole observer
class MyObserver implements ShouldQueue {
....
}
(tested in Laravel 10)
fyaren liked a comment+100 XP
5mos ago
Just found out that it doesn't even work with 0 and 1 coming from mysql tinyint column which is the schemabuilder boolean() method's datatabase type. To solve the issue I had to add a cast for the properties that are tinyint converting it to bool. It is not the end of the world but adds some pain to the upgrade process.
protected $casts = [
'opt_in_email' => 'bool',
'opt_in_phone' => 'bool',
];
fyaren liked a comment+100 XP
5mos ago
I love how Lary grabs your suggestion and then replays it like its factual. (actually I hate it)
From the docs
By binding multiple checkboxes to the $updateTypes property, the user can select multiple update types and they will be added to the $updateTypes array property:
<input type="checkbox" value="email" wire:model="updateTypes">
<input type="checkbox" value="sms" wire:model="updateTypes">
<input type="checkbox" value="notificaiton" wire:model="updateTypes">
For example, if the user checks the first two boxes but not the third, the value of $updateTypes will be: ["email", "sms"]
So I have no idea what Lary is on about.
First off, I would examine the HTML in the browser. There you can check the correct value is actually being set on the checkbox