md5 media file names

This commit is contained in:
HolgerHatGarKeineNode
2023-02-02 15:54:47 +01:00
parent 104ae8c0a6
commit 5d3919466f
8 changed files with 79 additions and 13 deletions

View File

@@ -41,6 +41,7 @@ class CommentBookCase extends Component
$this->bookCase
->addMedia($this->photo)
->usingFileName(md5($this->photo->getClientOriginalName()) . '.' . $this->photo->getClientOriginalExtension())
->toMediaCollection('images');
return to_route('bookCases.comment.bookcase', ['country' => $this->country, 'bookCase' => $this->bookCase->id]);

View File

@@ -151,10 +151,12 @@ class BookCaseTable extends DataTableComponent
$orangePill
->addMedia($this->photo)
->preservingOriginal()
->usingFileName(md5($this->photo->getClientOriginalName()).'.'.$this->photo->getClientOriginalExtension())
->toMediaCollection('images');
$orangePill->load(['media']);
$this->currentModal
->addMedia($this->photo)
->usingFileName(md5($this->photo->getClientOriginalName()).'.'.$this->photo->getClientOriginalExtension())
->toMediaCollection('images');
if ($this->orangepill['comment']) {
$this->currentModal->comment($this->orangepill['comment'], null);