Store multiple fields in JSON column (Nova CMS)



PHP Snippet 1:

 public function fields(Request $request)
    {
        return [
            ID::make(__('ID'), 'id')->sortable(),

                new Panel(__('Read More'), [                

                    Flexible::make('Specifications', read_more_section)
                       ->addLayout(ReadMoreLayout::class)
                       ->limit(1),
                    
                ]),

               
        ];
    }

PHP Snippet 2:

class ReadMoreLayout extends Layout
{
    /**
     * The layout's unique identifier
     *
     * @var string
     */
    protected $name = 'title';

    /**
     * The displayed title
     *
     * @var string
     */
    protected $title = 'Read More Section';

    protected $limit = 1;

    /**
     * Get the fields displayed by the layout.
     *
     * @return array
     */
    public function fields()
    {
        return [
                Text::make('Title')->rules(['max:255']),
                Text::make('Description'),
                Text::make('Label'),
                Text::make('Link'),
        ];
    }
}