Crud: Hide Action row

Created on 31 Jan 2017  路  5Comments  路  Source: Laravel-Backpack/CRUD

$this->crud->denyAccess(['create', 'update', 'reorder', 'delete']);
i want to show list only so no need of blank actions column

Most helpful comment

Hi @karandatwani92 ,

Try $this->crud->removeAllButtons() or $this->crud->removeAllButtonsFromStack('line').

Should hide it for you.

Cheers!

All 5 comments

Maybe you can copy list.blade.php from the /vendor folder to your /ressource folder and just remove the column. But it will remove it for all the crud lists of your project.

Hi @karandatwani92 ,

Try $this->crud->removeAllButtons() or $this->crud->removeAllButtonsFromStack('line').

Should hide it for you.

Cheers!

How I can hide action column. I used what is mentioned here but no success

I used this code bellow
$this->crud->denyAccess('show');
$this->crud->denyAccess('create');
$this->crud->denyAccess('delete');
$this->crud->denyAccess('update');

All buttons are hidden however the action column is still there and is smpty

In Backpack 4.0 you can completely hide the Actions column by removing all buttons from the "line" stack, when configuring the "List" operation:

protected function setupListOperation()
{
    // ..
    $this->crud->removeAllButtonsFromStack('line');
    // ..
}

Maybe we should create an alias to that? Something like hideActionsColumn()? If anybody else stumbles upon this thread and thinks we should add it, please say so.

If you remove all buttons from the line stack it's intended/expected that the column will not show.

The alias don't hurt, but we'll, in my opinion remove buttons is enough.

I think anyone that bumps into this will just remove the buttons.

Best

Was this page helpful?
0 / 5 - 0 ratings