V6 Uploaders - deleteWhenEntryIsDeleted not working #586
-
Hi guys, I have a problem with V6 uploaders, can you guys help me out? What do I want?When I delete the model/entry it will also delete the picture file What did I do?reading the documentation and trying it, also I already solved it but with v5 ways What is actually happening?It did not delete the picture file when I delete the model/entry Here's my backpack version### PHP VERSION:
PHP 8.1.10 (cli) (built: Aug 30 2022 18:05:49) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies
### LARAVEL VERSION:
10.16.1.0
### BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.0.2
backpack/crud: 6.0.6
backpack/generators: v4.0.2
backpack/theme-tabler: 1.0.6 Here's my controller CRUD::field('member_profile_picture')
->type('upload')
->withFiles([
'disk' => 'public', // the disk where file will be stored
'path' => '/uploads/member/', // the path inside the disk where file will be stored
]); I already solve it with backpack v5 ways, something like //inside my related model
public static function boot()
{
parent::boot();
static::deleting(function($obj) {
if($obj->member_profile_picture){
\Storage::disk('public')->delete($obj->member_profile_picture);
}
});
} Did I miss something? let me know, thank you 🙏. |
Beta Was this translation helpful? Give feedback.
Answered by
pxpm
Jul 26, 2023
Replies: 1 comment
-
moved to: Laravel-Backpack/CRUD#5234 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
christmex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moved to: Laravel-Backpack/CRUD#5234