z-song / laravel-admin

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

Is there any way to customize the Encore\Admin\Show element's actions? #5730

Closed r-shaygan closed 1 year ago

r-shaygan commented 1 year ago

how to change the 'list', 'edit', and 'delete' URL in the Encore\Admin\Show element? I know by setResource method, can set resource but I need to link them separately

alexoleynik0 commented 1 year ago

Yes, you can -- it's called panel there. So disabling defaults and adding your own should do the trick.

You can also use this in app/Admin/bootstrap.php to modify all Show views/panels.

Show::init(function (Show $show) {
    $show->panel()->tools(function (Show\Tools $tools) {
        $tools->append('<a href="#" class="btn btn-sm btn-default">Some button</a>');
    });
});