Laravel-admin: How could I customize the "add button" URI in grid?

Created on 24 Mar 2017  ·  1Comment  ·  Source: z-song/laravel-admin

Hello,

The add button URI of the grid is defined by the currently URL.
For example,
Current URL: xxx.com/admin/articles
URI of add button: /admin/articles/create

If I want to change the URI of add button to something like /admin/comments/create, how should I do?

I have this idea because I put 2 grid with different model in the same page. Each of them need their own URI path of the add button.

Thank you.

Most helpful comment

You can't customize the add button.

But you can remove the button by using $grid->disableCreation();, and add a custom tool for grid like following:

$grid->tools(function ($tools) {
    $tools->append("<a href='your-create-URI' class='btn btn-default'>Create</a>");
});

>All comments

You can't customize the add button.

But you can remove the button by using $grid->disableCreation();, and add a custom tool for grid like following:

$grid->tools(function ($tools) {
    $tools->append("<a href='your-create-URI' class='btn btn-default'>Create</a>");
});
Was this page helpful?
0 / 5 - 0 ratings

Related issues

abufalbo picture abufalbo  ·  3Comments

fokoz picture fokoz  ·  3Comments

greentornado picture greentornado  ·  3Comments

piian picture piian  ·  3Comments

clock1129 picture clock1129  ·  3Comments