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

jadamec's avatar

jadamec liked a comment+100 XP

1w ago

Laravel-mix is breaking ...

This worked for me:

"devDependencies": {
    "laravel-mix": "^6.0.49",
    "webpack": "5.93.0"
},
"resolutions": {
    "webpack": "5.93.0"
},
jadamec's avatar

jadamec liked a comment+100 XP

2w ago

shadcn/ui Deconstructed: Ep 6, Class Variance Authority

I love this series! These lessons are gold. Thank you @simonswiss

jadamec's avatar

jadamec liked a comment+100 XP

3w ago

React, The Laravel Way: Ep 29, PUT Method Spoofing

Hi, I really enjoyed this course, thank you!

If you're using the latest version of the Starter Kit with Wayfinder, I like this way of handling forms. We avoid using useForm, specify the PUT method, and the images are handled automatically. Just import Form from Inertia and PuppyController from actions.

jadamec's avatar

jadamec liked a comment+100 XP

3w ago

React, The Laravel Way: Ep 23, Command To Delete Unused Images

It's nice to have a command to do this. Handy :) An alternative method I've found and use quite often is to use the booted method on the Model. So when the model is deleted it will delete any associated files. If we are deleting Puppies using Eloquent the clean up will happen for each one.

Alter the image path depending on what you stored in the DB... my version is:

protected static function booted(): void
{
    static::deleting(function ($puppy) {
        $path = str_replace('/storage/', '', $puppy->image_url);
        Storage::disk('public')->delete($path);
    });
}
jadamec's avatar

jadamec liked a comment+100 XP

1mo ago