承接 ronnytorresmtz/dropdown-inline 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ronnytorresmtz/dropdown-inline

Composer 安装命令:

composer require ronnytorresmtz/dropdown-inline

包简介

A Laravel Nova field.

README 文档

README

This package allow you to edit a Dropdown field in the index page with one click

Installation

    composer require ronnytorresmtz/dropdown-inline

Usage

Add the field to your resource without edition

public function fields(Request $request)
{
        return [

                DropdownInline::make('Start Date') 
                    ->options([
                        0 => 'Activo',
                        1 => 'No Activo',
                    ]),

        ];
        
}

To edit the Dropdown field you need to click it on.

If you press the Esc key or lost the focues the field will became not editable.

Add the field to your resource and allow to edit with one click

public function fields(Request $request)
{
        return [

               DropdownInline::make('Start Date') 
                    ->options([
                        0 => 'Activo',
                        1 => 'No Activo',
                    ])
                    ->inlineOnIndex(),
                
        ];
        
}

Show the option label instead of the value

public function fields(Request $request)
{
        return [

               DropdownInline::make('Start Date') 
                    ->options([
                        0 => 'Activo',
                        1 => 'No Activo',
                    ])
                    ->inlineOnIndex()
                    ->displayUsingLabels(),
                
        ];
        
}

WATCH OUT: This field needs the displayUsingLabels method to be set if not the field does not work well with values.

This method also accepts a closure with the current request if you want to make it editable dynamically:

public function fields()
{
    return [
         DropdownInline::make('Start Date') 
                ->options([
                0 => 'Activo',
                1 => 'No Activo',
                ])
                ->displayUsingLabels()
                ->inlineOnIndex(function (NovaRequest $request) {
                        return $request->user()->isAdmin();
                }),
    ];
}

统计信息

  • 总下载量: 77
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固