© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
13 replies
hxn

Uploaded image not deleted on delete

When deleting a record the image in storage isnt deleted.

I've tried something like this but record is protected
->actions([
  Tables\Actions\EditAction::make(),
  Tables\Actions\DeleteAction::make()
    ->after(function ($action){
      unlink(storage_path('app/public/'. $action->record->image_url));
   }),
])
->actions([
  Tables\Actions\EditAction::make(),
  Tables\Actions\DeleteAction::make()
    ->after(function ($action){
      unlink(storage_path('app/public/'. $action->record->image_url));
   }),
])
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Manipulation on uploaded image before save
FilamentFFilament / ❓┊help
2y ago
Fileupload delete image on filesystem (avatar)
FilamentFFilament / ❓┊help
11mo ago
DeleteBulkAction do not check for delete_any policy
FilamentFFilament / ❓┊help
2mo ago
Making 2 version of uploaded image
FilamentFFilament / ❓┊help
16mo ago