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]: Throwing errors when not using relationships #22

Closed awcodes closed 8 months ago

awcodes commented 8 months ago

What happened?

Upgraded the package from 3.1.2 -> 3.2.0 and now List is throwing errors about releationships and missing traits.

Adding the trait to my model, however causes the form to break, since it is looking for a relationship on the AdjacencyList component.

https://flareapp.io/share/NPLWWAQm

How to reproduce the bug

AdjacencyList::make('items')
      ->columnSpanFull()
      ->form([
          Forms\Components\TextInput::make('label')
              ->required(),
          Forms\Components\TextInput::make('url')
              ->required(),
          Forms\Components\Select::make('target')
              ->options(...),
          Forms\Components\CheckboxList::make('rel')
              ->columnSpan(1)
              ->columns(3)
              ->options(...,
      ]),

Package Version

v3.2.0

PHP Version

8.2

Laravel Version

10.0

Which operating systems does with happen with?

macOS

Notes

No response