outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
274 stars 97 forks source link

Deleting an image doesn't actually remove the image from the filesystem #127

Closed bluec closed 2 years ago

bluec commented 2 years ago

The \OptimistDigital\NovaSettings\Http\Controllers\SettingsController::deleteImage method doesn't actually delete the image from the filesystem it only sets the setting value to null.

We could force a delete like this example below but it would be better to hook into the Nova Image field instance and delete it that way, does anyone have any idea how to do that? I will file a PR if we can figure it out!

Storage::disk('public')->delete($existingRow->value);
bluec commented 2 years ago

Whoops just realised this is pretty much a dupe of #125 - I had searched for "image" in the issues so not noticed that issue was already open.

Tarpsvo commented 2 years ago

Thanks for reporting this! Fixed in version 5.0.3. ;)

bluec commented 2 years ago

@Tarpsvo thanks, would you consider back-porting this to v3 branch too? I could make a PR if you like.

Tarpsvo commented 2 years ago

Heya! Released the Nova 3 fix in version 3.5.7.

bluec commented 2 years ago

Thank you @Tarpsvo amazing!