bytelaunch/readonly-on-update

Laravel Nova 工具。

dev-main 2020-11-21 00:10 UTC

This package is auto-updated.

Last update: 2024-09-21 08:25:05 UTC


README

此包为您的字段提供 readonlyOnUpdate() 方法。

示例

Example

要求

此包需要

  • PHP ^7.3。
  • Laravel Nova ^2.0 或 ^3.0。

安装

您可以通过 composer 在使用 Nova 的 Laravel 应用中安装此包

composer require bytelaunch/readonly-on-update

用法

在您的资源实现中添加以下代码

<?php

...

class YourResource extends Resource {

    ...

    public function fields(Request $request)
    {
        return [
            ...

            // Are you ready?
            // --------------
            // 1. Use readonlyOnUpdate() method
            // 2. See the results
            Field::make(__('Column'), 'column') // Use whatever Field
                ->readonlyOnUpdate()
        ];
    }

免责声明

此包未经过测试,但对我来说效果良好。欢迎提交 PR 进行改进。