Giter VIP home page Giter VIP logo

laravel-admin-extras's Introduction

laravel-admin-extras

针对laravel-admin做的部分扩展

安装

composer require guolei19850528/laravel-admin-extras

php artisan vendor:publish --tag=laravel-admin-extras

Form扩展使用

$form->radioButton('column', __('text'));
//替换为
$form->extraRadioButton('column', __('text'));

$form->checkboxButton('column', __('text'));
//替换为
$form->extraCheckboxButton('column', __('text'));

//json editor
//option see https://github.com/jdorn/json-editor/
$form->extraJsonEditor('json_column', __('text'))->setOptions([]);

//belongsTo
//扩展归属选择单选
$form->extraBelongsTo('column', Selectable::class, 'Text')
            ->addModalLoadScript(<<<SCRIPT
//此处为处理下拉选择框显示bug
//{{column}} 归属选择字段
//{{sub-column}} 归属选择字段中需要下拉框显示的字段值
$("#modal-selector-{{column}} .{{sub-column}}").select2({
    placeholder: {id:"",text:"选择"},
    allowClear:true
});
SCRIPT
            );

//BelongsToMany
//扩展归属选择单选
$form->BelongsToMany('column', Selectable::class, 'Text')
            ->addModalLoadScript(<<<SCRIPT
//此处为处理下拉选择框显示bug
//{{column}} 归属选择字段
//{{sub-column}} 归属选择字段中需要下拉框显示的字段值
$("#modal-selector-{{column}} .{{sub-column}}").select2({
    placeholder: {id:"",text:"选择"},
    allowClear:true
});
SCRIPT
            );

Detail扩展使用

$show->field('date_column', __('text'))->extraDateFormatter($formatter = 'Y-m-d H:i:s');

Grid扩展使用

$grid->column('date_column', __('text'))->extraDateFormatter($formatter = 'Y-m-d H:i:s');

laravel-admin-extras's People

Contributors

guolei19850528 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.