Laravel-admin: 如何禁止特定刪除按鈕

Created on 28 Mar 2017  ·  3Comments  ·  Source: z-song/laravel-admin

請問在grid中,如何禁止特定刪除按鈕?
想呈現如圖的效果
asking01

Most helpful comment

$grid->actions(function ($actions) {
    if ($actions->getKey() % 2 == 0) {
        $actions->disableDelete();
    }
});

这样?

All 3 comments

$grid->actions(function ($actions) {
    if ($actions->getKey() % 2 == 0) {
        $actions->disableDelete();
    }
});

这样?

感謝!

@z-song
如果重定义了actions列,好像就不可以了

Was this page helpful?
0 / 5 - 0 ratings