F
Filament14mo ago
Askancy

Repeater::simple does not exist

I am using a repeater with the simple method, but I get this error:
Section::make('Pro Cons')
->schema([
Repeater::make('Pro')
->simple(
TextInput::make('pro'),
),

Repeater::make('Cons')
->simple(
TextInput::make('cons'),
)
])
->collapsible(),
Section::make('Pro Cons')
->schema([
Repeater::make('Pro')
->simple(
TextInput::make('pro'),
),

Repeater::make('Cons')
->simple(
TextInput::make('cons'),
)
])
->collapsible(),
>Method Filament\Forms\Components\Repeater::simple does not exist. I also take this opportunity to ask, I currently have data within a saved sql column, each element is separated by |:
Little choice in weapons|IA sometimes unresponsive
Little choice in weapons|IA sometimes unresponsive
How should I convert it to fit filamentphp? I need to create an example pivot column:
Schema::create('review_pivot_cons', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('review_id');
$table->unsignedBigInteger('cons');
$table->timestamps();

$table->foreign('review_id')->references('id')->on('review')->onDelete('cascade');
});
Schema::create('review_pivot_cons', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('review_id');
$table->unsignedBigInteger('cons');
$table->timestamps();

$table->foreign('review_id')->references('id')->on('review')->onDelete('cascade');
});
could it work? In the case, how do I "populate" the textinputs?
6 Replies
krekas
krekas14mo ago
what's your filament version?
Askancy
AskancyOP14mo ago
"filament/filament": "3.0-stable",
krekas
krekas14mo ago
That's not version I'm asking the full installed version
Askancy
AskancyOP14mo ago
Ok I removed the -stable from the composer, updated and now it works. I am now at v3.0.63 Instead on how to solve my other problems, am I taking the correct path? I need to work on an already populated database, and I need to convert it following the conventions of Filamentphp
cheesegrits
cheesegrits14mo ago
If this is legacy data and you don't have to keep the same format moving girward, then best write a little script to recreate the data in separate tables and adding the pivots. I usually write that kind of thing as a little artisan command.
Askancy
AskancyOP14mo ago
I created a script and converted everything to a pivot table, so it is also neater, however how do I call the fields in a TextInput in repater? If I click edit, the fields do not load, the relationship property seems not to exist for TextInput I am using this relationship:
public function pros(): hasMany
{
return $this->hasMany(ReviewPivotPro::class, 'review_id', 'id');
}
public function pros(): hasMany
{
return $this->hasMany(ReviewPivotPro::class, 'review_id', 'id');
}
No description
Want results from more Discord servers?
Add your server