Spatie media library in livewire component

Hello, everyone. I am using Spatie Media Library upload. I have this component
SpatieMediaLibraryFileUpload::make('energy_invoice')
->label(__('app.resources.work_points.energy_invoices'))
->collection('energy_invoices')
->maxSize(5000)
->downloadable(),
SpatieMediaLibraryFileUpload::make('energy_invoice')
->label(__('app.resources.work_points.energy_invoices'))
->collection('energy_invoices')
->maxSize(5000)
->downloadable(),
I have this in my model
*/
class CompanyConsumption extends Model implements HasMedia
{
use HasCompany, HasFactory ,InteractsWithMedia;
*/
class CompanyConsumption extends Model implements HasMedia
{
use HasCompany, HasFactory ,InteractsWithMedia;
and the form in livewire component has this model
])->model($this->companyConsumption);
])->model($this->companyConsumption);
With all of this it seems that the upload doesn't work. It doesn't do anything. Can you assist me with this?
1 Reply
Hasith
Hasith8mo ago
Can we use these plugins outside of the filament panel inside a Laravel component? I only use Filament Forms

Did you find this page helpful?