Closed tangjh closed 4 months ago
v3
v3.0.2
PHP 8.1.27
ErrorException: Undefined array key 0 when creating a new Item:
Click on New:
Code: public static function form(Form $form): Form { return $form ->schema([ Forms\Components\TextInput::make('field1'), Forms\Components\TextInput::make('field2'), Forms\Components\TextInput::make('field3'), \Awcodes\TableRepeater\Components\TableRepeater::make('details') ->relationship('details') ->schema([ Forms\Components\TextInput::make('field4'), Forms\Components\TextInput::make('field5'), Forms\Components\TextInput::make('field6') ->hidden(fn (string $operation): bool => $operation === 'view'), ]), ]); }
Migration: /**
Run the migrations. */ public function up(): void { Schema::create('purchase_orders', function (Blueprint $table) { $table->id();
$table->string('field1'); $table->string('field2'); $table->string('field3'); $table->timestamps(); }); Schema::create('purchase_order_details', function (Blueprint $table) { $table->id(); $table->foreignId('purchase_order_id'); $table->string('field4'); $table->string('field5'); $table->string('field6'); $table->timestamps(); });
}
/**
Display the creation form
As explain above
No response
Please review the readme. You need to define your Headers.
Headers
Filament Version
v3
Plugin Version
v3.0.2
PHP Version
PHP 8.1.27
Problem description
ErrorException: Undefined array key 0 when creating a new Item:
Click on New:
Code: public static function form(Form $form): Form { return $form ->schema([ Forms\Components\TextInput::make('field1'), Forms\Components\TextInput::make('field2'), Forms\Components\TextInput::make('field3'), \Awcodes\TableRepeater\Components\TableRepeater::make('details') ->relationship('details') ->schema([ Forms\Components\TextInput::make('field4'), Forms\Components\TextInput::make('field5'), Forms\Components\TextInput::make('field6') ->hidden(fn (string $operation): bool => $operation === 'view'), ]), ]); }
Migration: /**
Run the migrations. */ public function up(): void { Schema::create('purchase_orders', function (Blueprint $table) { $table->id();
}
/**
Expected behavior
Display the creation form
Steps to reproduce
As explain above
Reproduction repository
No response
Relevant log output
No response