saade / filament-adjacency-list

A Filament package to manage adjacency lists (aka trees).
https://filamentphp.com/plugins/saade-adjacency-list
MIT License
76 stars 13 forks source link

[Bug]: Error in create resource #4

Closed 0528Makoto closed 1 year ago

0528Makoto commented 1 year ago

What happened?

Add in form

public static function form(Form $form): Form
    {
        return $form
            ->schema([
                AdjacencyList::make('Subjects')
                    ->form([
                        Forms\Components\TextInput::make('name')
                            ->required(),
                    ])
                ->labelKey('name')
            ]);
    }

image

image

image

Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, string given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php on line 1040

How to reproduce the bug

Create new resource

Add items

Save resource

Package Version

3.0.3

PHP Version

8.2.9

Laravel Version

10.20.0

Which operating systems does with happen with?

Linux

Notes

No response

saade commented 1 year ago

can you share your model?

0528Makoto commented 1 year ago
<?php

namespace App\Models\Simulation;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Staudenmeir\LaravelAdjacencyList\Eloquent\HasRecursiveRelationships;

class Subject extends Model
{
    use HasFactory;
    use HasRecursiveRelationships;

    protected $table = "simulation_subjects";
}
saade commented 1 year ago

relationship support is not merged yet, see

will be released by the end of tomorrow.