10-04-2026

This commit is contained in:
Kevin Adametz 2026-04-10 17:18:17 +02:00
parent 4d6b4930b2
commit 4bb89aad8c
836 changed files with 52961 additions and 5950 deletions

View file

@ -0,0 +1,39 @@
<?php
namespace App\Livewire\Admin\Cms;
use Livewire\Attributes\Validate;
use Livewire\Component;
use Livewire\WithFileUploads;
class MediaUploader extends Component
{
use WithFileUploads;
public string $field = '';
public string $accept = 'image/*';
public string $disk = 'public';
public string $directory = 'cms/uploads';
#[Validate('file|max:10240')]
public $file;
public function updatedFile(): void
{
$this->validate();
$path = $this->file->store($this->directory, $this->disk);
$this->dispatch('media-uploaded', field: $this->field, path: '/storage/'.$path);
$this->file = null;
}
public function render()
{
return view('livewire.admin.cms.media-uploader');
}
}