【问题标题】:Hide button "Create & Add Another" by condition in Laravel Nova在 Laravel Nova 中按条件隐藏按钮“创建和添加另一个”
【发布时间】:2019-04-04 09:55:59
【问题描述】:

如果我通过引用相关资源创建新资源

new?viaResource=some-resource&viaResourceId=8&viaRelationship=another-sesource

我想隐藏“创建并添加另一个”按钮。

https://i.stack.imgur.com/M3Hy6.png

【问题讨论】:

  • 嗨,你有没有找到解决办法?

标签: laravel laravel-nova


【解决方案1】:

https://github.com/laravel/nova-issues/issues/1620#issuecomment-516384334

这可以使用自定义 CSS 轻松完成:

  1. 用下一行创建public/css/custom.css

    button[dusk='update-and-continue-editing-button'], button[dusk='create-and-add-another-button'] {
        display: none;
    }
    
  2. NovaServiceProvider.php中安装custom.css

    public function boot()
        {
            parent::boot();
            Nova::style('custom-fields-css', public_path('css/custom.css'));
        }
    

【讨论】:

    猜你喜欢
    • 2020-07-24
    • 2019-08-28
    • 1970-01-01
    • 1970-01-01
    • 2011-09-04
    • 1970-01-01
    • 2019-11-01
    • 1970-01-01
    • 2018-09-08
    相关资源
    最近更新 更多