Replies: 2 comments 9 replies
-
Hi, I was able to solve this with add extra relations to Rule model: |
Beta Was this translation helpful? Give feedback.
0 replies
-
I tried your process, but I got a data type problem, can you help me? |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have two models:
Relations:
Rule:
public function IInterfaces() { return $this->belongsTo(IInterface::class, 'i_interface_id'); }
Interface:
public function Rules() { return $this->HasMany(Rule::class); }
But the interface model is usable as input interface and out interface. For this i have to add an extra foreign key to Rule table:
In Rule form, i can use this, which is working fine:
Forms\Components\Select::make('out_i_interface_id') ->relationship('IInterfaces', 'name') ->label('OUT interface'),
But in Columns on Rule list, the "OUT" column can not use, because i cant define the relation that i want to use
Tables\Columns\TextColumn::make('out_i_interface_id') ->label('Out Interface') ->searchable() ->sortable(),
Describe the solution you'd like
Maybe can port relationship() from Select?
Can you help with this?
Thanks!
BR,
Z
Beta Was this translation helpful? Give feedback.
All reactions