The exception shows you exactly which file and which line your error Method Filament\Forms\Components\FileUpload::table does not exist. shows. Which file and which line is that?
Jan 10, 2023
2
Level 1
Method Filament\Forms\Components\FileUpload::table does not exist.
hi i need help
Method Filament\Forms\Components\FileUpload::table does not exist.
I can't understand what is my mistake, I need help guys, help me out
outdoctorresource.php
return $form
->schema([
Card::make()->schema([
TextInput::make('title')
->label('заголовок')
->reactive()
->afterStateUpdated(function (Closure $set, $state) {
$set('slug', Str::slug($state));
})->required(),
TextInput::make('desk')->label('специальность'),
FileUpload::make('image')->image()->label('прикрепить файл'),
FileUpload::make('attachment')->minSize(10)->label('минимальный размер 10Кб'),
FileUpload::make('attachment')->minSize(4096)->label('максимальный размер 4096Кб'),
TinyEditor::make('content')->required()->label('содержание'),
Toggle::make('is_published')->label('видимость')
])
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('id')->sortable()->searchable()->label('номер'),
TextColumn::make('title')->limit(20)->label('заголовок')->sortable()->searchable(),
TextColumn::make('desk')->limit(50)->label('описание')->sortable()->searchable(),
FileUpload::make('attachment')->label('файл')->preserveFilenames(),
BooleanColumn::make('is_published')->searchable()->label('видимость'),
])
my model
class OurDoctor extends Model
{
protected $fillable =
[
'desk',
'attachment',
'content',
'is_published',
];
}
my migration
public function up()
{
Schema::create('our_doctors', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('desk')->nullable();
$table->text('content');
$table->text('image')->nullable();
$table->text('attachment');
$table->boolean('is_published')->default(false);
$table->timestamps();
});
}
php artisan migration:fresh run but still error
Please or to participate in this conversation.