Hi, I have an edit class for my model named Post. How do I display the attached file that exists on the database? The file was uploaded using the Spatie Media Library plugin for filamentPHP
This is my livewire class Edit.php.
<?php
namespace App\Http\Livewire\Posts;
class Edit extends Component implements Forms\Contracts\HasForms
{
use Forms\Concerns\InteractsWithForms;
public Post $post;
public $descripton;
public function mount(): void
{
$this->form->fill([
'description' => $this -> post -> description,
'attachment' => $this -> post -> getMedia('post-attachments')
]);
}
Only the property description was pulled from database and displayed on the edit form