z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.15k stars 2.82k forks source link

how to create a popup box in grid using another dbtable? #5762

Open jesnagifto opened 1 year ago

jesnagifto commented 1 year ago

Description:

$grid->column('Details')->modal('operations', function ($model) {

$comments = $model->Operations()->take(10)->get()->map(function ($comment) {
    return $comment->only(['id', 'location', 'image']);
});

return new Table(['ID', 'Fishname', 'Locataion'], $comments->toArray());

});

2023-05-05

Steps To Reproduce:

jesnagifto commented 1 year ago

the values not showing? how to solve this?

technilogics commented 1 year ago

check the relationship Operations referred in $model->Operations()