filament/filament
v3.2.124
10.48.24
No response
PHP 8.2.25
I have CustomerResource to handle Customer CRUD. I want to implement that File upload capability for the customers.I have installed Spatie Media Library plugin then created a relation manager. My purpose is to upload file with relation manager. I have set the resource form. It is listed as expected but, when I upload file and it throws SQL error:
I was expecting to see upload file the local and insert data to table
<?php
namespace App\Filament\Resources\CustomerResource\RelationManagers;
use App\Models\Customer;
use App\Models\Media;
use Filament\Forms;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class MediaRelationManager extends RelationManager
{
protected static string $relationship = 'media';
protected static ?string $title = 'Dosyalar';
protected static ?string $modelLabel = 'Dosya';
protected static ?string $pluralModelLabel = 'Dosyalar';
public function isReadOnly(): bool
{
return false;
}
public function form(Form $form): Form
{
return $form
->schema([
SpatieMediaLibraryFileUpload::make('attachment')->collection('test')->multiple(),
])
->model($this->getOwnerRecord())
;
}
public function table(Table $table): Table
{
return $table
->recordTitleAttribute('name')
->columns([
Tables\Columns\TextColumn::make('name'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
}
I went to customer view page and try to upload file
https://github.com/firatdgn/filament-issue
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too