Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fyaren's avatar

fyaren liked a comment+100 XP

1w ago

How to use crontab in Herd?

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's avatar

fyaren liked a comment+100 XP

4mos ago

Queue observer

Old topic but maybe useful for someone : you can simply queue a whole observer

class MyObserver implements ShouldQueue {
    ....
}

(tested in Laravel 10)

fyaren's avatar

fyaren liked a comment+100 XP

5mos ago

Livewire 3: Checkbox not working properly

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's avatar

fyaren liked a comment+100 XP

5mos ago

Livewire 3: Checkbox not working properly

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