F
Filament11mo ago
Sam ツ

Infolist and foreignid

Hi, I am quite new to laravel / filaments and am transfering one of my projects to Filament but I am struggling with foreign keys (I do think the answer might be quite straightforward) I am trying to show data retrieved from a foreign key, I want to retrieve the serial_number vfrom "devices" via the constrain that exists with "tasks" I can not quite find any documentation of this This is my infolist
Section::make("Technical Information")->schema([
Group::make([
TextEntry::make('task_reference')->name("Task Nr")->copyable()->inlineLabel(),
TextEntry::make('serial_number')->,

]),


]),
Section::make("Technical Information")->schema([
Group::make([
TextEntry::make('task_reference')->name("Task Nr")->copyable()->inlineLabel(),
TextEntry::make('serial_number')->,

]),


]),
And this is my constrain as defined in tasks
public function device()
{
return $this->belongsTo(Device::class);
}
public function device()
{
return $this->belongsTo(Device::class);
}
Thanks in advance!
Solution:
Try dot notation: device.serial_number
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch11mo ago
Try dot notation: device.serial_number
Sam  ツ
Sam ツOP11mo ago
That solved it, thank you
Want results from more Discord servers?
Add your server