what is orchid panel ?
Aug 28, 2022
5
Level 1
Upload/Picture form update images with deleting
Hey!
I have a little bit problem. I hope someone can help me. I Upload images in Orchid Panel, and attach them a Model, it is working, but when I try to update images an exist Model like deleting, the image still is on storage, and after refresh it is appeared again. No error message in Console (like javascript), or from laravel.

After upload I try to delete it in dropzone with X, After delete Post in attachments table is not deleted I worked from original Docs ( BTW. in list sort doesnt work too, icons appeared, clickable, but after click doesnt happened anything.)
Delete function
public function remove(Post $post)
{
$post->attachment->each->delete();
$post->delete();
//Storage::delete($post->attachment);
Alert::info('You have successfully deleted the post.');
return redirect()->route('platform.post.list');
}
CreateOrUpdate
public function createOrUpdate(Post $post, Request $request)
{
$request->validate([
'post.title' => 'required',
]);
$post->fill($request->get('post'))->save();
$post->attachment()->syncWithoutDetaching(
$request->input('post.attachment', [])
);
Alert::info('You have successfully created an post.');
return redirect()->route('platform.post.list');
}
Upload form
Upload::make('post.attachment')
->acceptedFiles('image/*,.psd')
->title('Upload image files'),
Please or to participate in this conversation.