当前位置: 首页>>代码示例>>PHP>>正文


PHP Column::custom方法代码示例

本文整理汇总了PHP中Column::custom方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::custom方法的具体用法?PHP Column::custom怎么用?PHP Column::custom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Column的用法示例。


在下文中一共展示了Column::custom方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: use

<?php

/** @var \SleepingOwl\Admin\Model\ModelConfiguration $model */
$model = Admin::model(\App\HistoryEvent::class);
$model->title('История – события');
$model->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('date');
    $display->columns([Column::checkbox(), Column::string('date.title')->label('Дата'), Column::custom()->label('Заголовок')->callback(function ($instance) {
        $res = $instance->title;
        if ($instance->more) {
            $res .= '<br><div class="label label-primary">Кнопка – подробней</div>';
        }
        return $res;
    }), Column::datetime('date_event')->format('d.m.Y')->label('Точная дата события'), Column::datetime('created_at')->label('Создан')->format('d.m.Y в H:i')]);
    $display->apply(function (\Illuminate\Database\Eloquent\Builder $query) {
        $query->withTrashed();
    });
    return $display;
})->createAndEdit(function ($id) use($model) {
    $model->title($id ? 'Редактировать событие' : 'Создать событие');
    $form = AdminForm::form();
    $form->items([FormItem::text('title', 'Заголовок'), FormItem::image('image', 'Картинка'), FormItem::select('history_date_id', 'Дата')->model(\App\HistoryDate::class)->display('title')->required(), FormItem::ckeditor('description', 'Описание')->required(), FormItem::date('date_event', 'Точная дата события'), FormItem::checkbox('more', 'Показать кнопку – подробней')]);
    return $form;
});
开发者ID:stcoder,项目名称:uf-vova,代码行数:25,代码来源:HistoryEvent.php

示例2: foreach

     })]);
     $mainDisplay->order([3, 'desc']);
     $secondaryDisplay = AdminDisplay::datatables();
     $secondaryDisplay->apply(function ($query) {
         $query->onlyTrashed();
     });
     $secondaryDisplay->columns([Column::checkbox(), Column::string('id'), Column::custom()->label('Картинка')->callback(function ($instance) {
         $attachment = $instance->attachments()->first();
         if (!is_null($attachment)) {
             if ($attachment->type === 'album') {
                 $attachment = $attachment->childs()->first();
             }
             return "<img class='thumbnail' width='80px' src='{$attachment->srcs['image_small']}'>";
         }
         return '';
     }), Column::custom()->label('Текст')->callback(function ($instance) {
         return str_limit($instance->text, 180);
     }), Column::datetime('date')->label('Создан')->format('d.m.Y в H:i'), Column::datetime('created_at')->label('Импортирован')->format('d.m.Y в H:i'), Column::datetime('deleted_at')->label('Удален')->format('d.m.Y в H:i')]);
     $secondaryDisplay->actions([Column::action('post_restore')->value('Восстановить записи')->icon('fa-refresh')->callback(function (\Illuminate\Database\Eloquent\Collection $collections) {
         if ($collections) {
             /** @var \App\Post $collection */
             foreach ($collections as $collection) {
                 $collection->restore();
             }
         }
     })]);
     $tabs = [];
     $tabs[] = AdminDisplay::tab($mainDisplay)->label('Активные записи')->active(true);
     $tabs[] = AdminDisplay::tab($secondaryDisplay)->label('Удаленные записи');
     return $tabs;
 });
开发者ID:stcoder,项目名称:uf-vova,代码行数:31,代码来源:Post.php

示例3: is_null

<?php

Admin::model('App\\Models\\Order')->title('')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with();
    $display->filters([]);
    $display->columns([Column::custom()->label('Команда')->callback(function ($instance) {
        $product = \App\Models\Product::all()->where('id', $instance->product_id)->first();
        return is_null($product) ? 'Неизвестный' : $product->title;
    }), Column::string('sum')->label('Сумма'), Column::custom()->label('Статус')->callback(function ($instance) {
        if ($instance->status == 0) {
            return '<p class="text-warning">Не оплачен</p>';
        } elseif ($instance->status == 1) {
            return '<p class="text-danger">Ошибка</p>';
        } else {
            return '<p class="text-success">Оплачен</p>';
        }
    })]);
    return $display;
})->createAndEdit(function () {
    return null;
});
开发者ID:proudly,项目名称:RefEng,代码行数:22,代码来源:Order.php

示例4:

<?php

Admin::model(App\Product::class)->title('Управление товарами')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('category');
    $display->filters([Filter::related('category_id')->model(App\Category::class)]);
    $display->columns([Column::string('name')->label('Название'), Column::string('price')->label('Цена'), Column::image('image')->label('Изображение'), Column::string('category.title')->label('Категория')->append(Column::filter('category_id')), Column::custom()->label('Топ')->callback(function ($instance) {
        return $instance->active ? 'да' : 'нет';
    }), Column::string('product_rest')->label('Остаток')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('name', 'Название'), FormItem::text('slug', 'Slug'), FormItem::text('price', 'Цена'), FormItem::image('image', 'Изображение'), FormItem::select('category_id', 'Категория')->model(App\Category::class)->display('title'), FormItem::checkbox('active', 'Топ'), FormItem::ckeditor('description', 'Описание'), FormItem::text('product_rest', 'Количество товара')->defaultValue('0')]);
    return $form;
});
开发者ID:DimaPikash,项目名称:eshop,代码行数:15,代码来源:Product.php

示例5:

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
Admin::model('App\\Models\\Webpage')->title('Webpages')->alias('webpage')->display(function () {
    $display = AdminDisplay::datatablesAsync();
    $display->order([[4, 'desc']]);
    $display->columns([Column::string('host')->label('Domain'), Column::string('path')->label('Path'), Column::custom()->label('Evaluations')->callback(function ($instance) {
        return $instance->evaluations()->count();
    }), Column::custom()->label('Enabled')->callback(function ($instance) {
        return $instance->is_enabled ? '&check;' : '&cross;';
    }), Column::datetime('created_at')->format('d-m-Y h:i:s')->label('Created')]);
    $display->columnFilters([ColumnFilter::text()->placeholder('Domain'), ColumnFilter::text()->placeholder('Path'), null, null, ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date'))]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::checkbox('is_enabled', 'Enabled'), FormItem::text('url', 'URL')->required(), FormItem::ckeditor('description', 'Description')]);
    return $form;
})->delete(null);
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:21,代码来源:Webpage.php

示例6:

        if ($instance->active) {
            return ' <span><i class="fa fa-chevron-down" data-toggle="tooltip" title="" data-original-title="Active"></i></span>';
        }
    })->orderable(false)]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->ajax_validation(true);
    $form->items([FormItem::columns()->columns([[FormItem::text('lable', 'lable'), FormItem::bsselect('user_id', 'User')->model('App\\User')->display('email')->defaultValue(Sentinel::getUser()->id), FormItem::icheckbox('active')->label('Active')->skin('flat')], [FormItem::text('comment_id', 'Page ID'), FormItem::text('comment_type')]]), FormItem::ckeditor('content', 'Content')]);
    return $form;
});
/**
 *  Sitemaps
 */
Admin::model('App\\Sitemap')->title('Sitemap')->alias('sitemaps')->display(function () {
    $display = AdminDisplay::table();
    $display->filters([Filter::field('loc')->title(function ($value) {
        return 'URL:' . $value;
    })]);
    $display->columns([Column::checkbox(), Column::string('loc')->label('loc'), Column::string('lastmod')->label('lastmod'), Column::string('changefreq')->label('changefreq'), Column::string('priority')->label('priority'), Column::string('updated_at')->label('updated_at'), Column::custom()->label('in_sitemap')->callback(function ($instance) {
        if ($instance->in_sitemap) {
            return ' <span><i class="fa fa-chevron-down" data-toggle="tooltip" title="" data-original-title="Active"></i></span>';
        }
    })->orderable(false)]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->ajax_validation(true);
    $form->items([FormItem::columns()->columns([[FormItem::text('loc', 'loc')->required(), FormItem::timestamp('lastmod', 'lastmod')->required(), FormItem::select('changefreq', 'changefreq')->enum(['always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'])->required(), FormItem::text('priority', 'priority')->required(), FormItem::icheckbox('in_sitemap')->label('In sitemap')]])]);
    return $form;
});
开发者ID:jetcms,项目名称:models,代码行数:31,代码来源:JetCmsModels.php

示例7:

<?php

Admin::model(\App\Models\Post::class)->title('Блог')->display(function () {
    $display = AdminDisplay::datatables();
    $display->columns([Column::string('id')->label('#'), Column::string('title')->label('Заголовок'), Column::custom()->label('Опубликован')->callback(function ($instance) {
        return $instance->published ? 'Да' : 'Нет';
    }), Column::datetime('created_at')->label('Дата создания')]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::checkbox('published', 'Опубликован')->defaultValue(1), FormItem::text('title', 'Заголовок')->required(), FormItem::ckeditor('body', 'Текст')->required()]])]);
    return $form;
});
开发者ID:kesha1,项目名称:blog.loc,代码行数:13,代码来源:Post.php

示例8: config

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Input;
use App\Product;
use App\UserProduct;
Admin::model('App\\User')->title('Пользователи')->display(function () {
    $display = AdminDisplay::datatables();
    $display->columns([Column::checkbox(), Column::string('id')->label('ID'), Column::string('name')->label('Имя'), Column::custom()->label('Актив.')->callback(function ($instance) {
        return $instance->is_active ? '&check;' : '-';
    }), Column::string('email')->label('Email'), Column::count('products')->label('Товаров')->orderable(true), Column::count('list_active_products')->label('Акт. товаров')->orderable(true), Column::string('balance')->label('Баланс')]);
    $display->columnFilters([null, ColumnFilter::select()->model('App\\User')->display('name'), null, null, null, null]);
    $display->actions([Column::action('export')->value('Раздать товары')->icon('fa-share')->callback(function ($collection) {
        $max_products_per_user = config('main.max_products_per_user', 3);
        foreach ($collection as $key => $user) {
            $active_products = $user->list_active_products;
            $count_active_products = count($active_products);
            if ($count_active_products >= 0 && $count_active_products < $max_products_per_user) {
                $random_product = Product::orderByRaw("RAND()")->first();
                try {
                    $user_product = UserProduct::create(['user_id' => $user->id, 'product_id' => $random_product->id]);
                } catch (QueryException $e) {
                    //Nothing
                }
            }
        }
开发者ID:Eduard90,项目名称:Laravel-5-Example,代码行数:31,代码来源:User.php

示例9:

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
Admin::model('App\\Models\\License')->title('Licenses')->alias('license')->display(function () {
    $display = AdminDisplay::datatablesAsync();
    $display->order([[0, 'asc']]);
    $display->columns([Column::string('name')->label('Name'), Column::string('duration')->label('Duration'), Column::custom()->label('Enabled')->callback(function ($instance) {
        return $instance->is_enabled ? '&check;' : '-';
    }), Column::custom()->label('Payed version')->callback(function ($instance) {
        return $instance->needs_validation ? '&check;' : '-';
    }), Column::datetime('created_at')->format('d-m-Y h:i:s')->label('Created'), Column::datetime('updated_at')->format('d-m-Y h:i:s')->label('Updated')]);
    $display->columnFilters([ColumnFilter::text()->placeholder('Name'), null, null, null, ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date')), ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date'))]);
    return $display;
})->edit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">Key</label><br/>
                                ' . $instance->key . '
                            </div>';
    }), FormItem::text('name', 'Name')->required(), FormItem::text('duration', 'Duration')->required(), FormItem::checkbox('is_enabled', 'Enabled'), FormItem::checkbox('needs_validation', 'Payed version'), FormItem::ckeditor('description', 'Description')]);
    return $form;
})->create(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('name', 'Name')->required(), FormItem::text('duration', 'Duration')->required(), FormItem::checkbox('is_enabled', 'Enabled'), FormItem::checkbox('needs_validation', 'Payed version'), FormItem::ckeditor('description', 'Description')]);
    return $form;
});
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:30,代码来源:License.php

示例10:

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
Admin::model('App\\Models\\Member')->title('Members')->alias('member')->display(function () {
    $display = AdminDisplay::datatablesAsync();
    $display->order([[0, 'asc']]);
    $display->columns([Column::checkbox(), Column::string('organization.name')->label('Organization'), Column::string('status')->label('Status'), Column::string('type')->label('Type'), Column::string('title')->label('Function'), Column::string('first_name')->label('Firstname'), Column::string('last_name')->label('Lastname'), Column::string('email')->label('Email'), Column::custom()->label('Enabled')->callback(function ($instance) {
        return $instance->is_enabled ? '&check;' : '-';
    }), Column::datetime('created_at')->format('d-m-Y h:i:s')->label('Created')]);
    $display->columnFilters([null, ColumnFilter::text()->placeholder('Organization'), null, null, null, null, null, ColumnFilter::text()->placeholder('Email'), null, ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date'))]);
    return $display;
})->edit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::checkbox('is_enabled', 'Enabled'), FormItem::select('organization_id', 'Organization')->model('App\\Models\\Organization')->display('name'), FormItem::text('first_name', 'Firstname'), FormItem::text('last_name', 'Lastname'), FormItem::text('email', 'Email')->unique(), FormItem::text('phone', 'Phone'), FormItem::text('url', 'Website'), FormItem::text('title', 'Function'), FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">Key</label><br/>
                                ' . $instance->key . '
                            </div>';
    }), FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">Status</label><br/>
                                ' . $instance->status . '
                            </div>';
    }), FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">Type</label><br/>
                                ' . $instance->type . '
                            </div>';
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:31,代码来源:Member.php

示例11: dd

<?php

Admin::model('App\\Contact')->title('Contacts')->display(function () {
    $display = AdminDisplay::table();
    $display->with('country', 'companies');
    $display->filters([Filter::related('country_id')->model('App\\Country')]);
    $display->columns([Column::image('photo')->label('Photo<br/><small>(image)</small>'), Column::string('fullName')->label('Name<br/><small>(string with accessor)</small>'), Column::datetime('birthday')->label('Birthday<br/><small>(datetime)</small>')->format('d.m.Y'), Column::string('country.title')->label('Country<br/><small>(string from related model)</small>')->append(Column::filter('country_id')), Column::count('companies')->label('Companies<br/><small>(count)</small>'), Column::lists('companies.title')->label('Companies<br/><small>(lists)</small>'), Column::custom()->label('Has Photo?<br/><small>(custom)</small>')->callback(function ($instance) {
        return $instance->photo ? '&check;' : '-';
    }), Column::action('my_action')->label('<small>(action)</small>')->value('Custom action')->target('_blank')->callback(function ($instance) {
        dd('Custom action called with instance:', $instance->toArray());
    })]);
    return $display;
})->createAndEdit(null)->delete(null);
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:13,代码来源:Contact.php

示例12:

<?php

/*
 * This is a simple example of the main features.
 * For full list see documentation.
 */
Admin::model('App\\Models\\Organization')->title('Organizations')->alias('organization')->display(function () {
    $display = AdminDisplay::datatablesAsync();
    $display->order([[0, 'asc']]);
    $display->columns([Column::checkbox(), Column::string('sector.name')->label('Sector'), Column::string('status')->label('Status'), Column::string('name')->label('Name'), Column::string('kvk')->label('Kvk number'), Column::string('url')->label('Website'), Column::custom()->label('Enabled')->callback(function ($instance) {
        return $instance->is_enabled ? '&check;' : '-';
    }), Column::datetime('created_at')->format('d-m-Y h:i:s')->label('Created')]);
    $display->columnFilters([null, ColumnFilter::text()->placeholder('Sector'), ColumnFilter::text()->placeholder('Name'), null, null, null, null, ColumnFilter::range()->from(ColumnFilter::date()->format('d.m.Y')->placeholder('From Date'))->to(ColumnFilter::date()->format('d.m.Y')->placeholder('To Date'))]);
    return $display;
})->edit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::checkbox('is_enabled', 'Enabled'), FormItem::select('sector_id', 'Sector')->model('App\\Models\\Sector')->display('name'), FormItem::text('name', 'Name')->required(), FormItem::text('kvk', 'Kvk Number')->unique(), FormItem::text('phone', 'Phone'), FormItem::text('email', 'Email'), FormItem::text('url', 'Website'), FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">Address</label><br/>
                                ' . $instance->locations->first()->location->street . '
                            </div>';
    }), FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">Zipcode</label><br/>
                                ' . $instance->locations->first()->location->postal_code . '
                            </div>';
    }), FormItem::custom()->display(function ($instance) {
        return '<div class="form-group ">
                                <label for="key">City</label><br/>
                                ' . $instance->locations->first()->location->city . '
                            </div>';
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:31,代码来源:Organization.php

示例13:

<?php

\Admin::model('App\\Landing')->title('Landing')->alias('landing')->display(function () {
    $display = AdminDisplay::table();
    $display->with('blocks');
    $display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('title')->label('Загаловок'), Column::string('active_status')->label('Статус'), Column::custom()->label('Блоки')->callback(function ($instance) {
        return '<a href="/admin/landing-blocks?landing_id=' . $instance->id . '">Редактировать</a>';
    })]);
    return $display;
})->edit(function ($id) {
    $form = AdminForm::tabbed();
    $fields = [];
    $fields['Main'] = [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::timestamp('publish_end', 'Дата и время олкончания публикация')->defaultValue(Carbon\Carbon::now()), FormItem::text('redirect', 'Редирект'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::image('image', 'Картинка')]])];
    $model = App\Landing::find($id);
    if ($model) {
        $path = base_path('App/AdminLanding/' . $model->name . '.php');
        if (is_file($path)) {
            $fields2 = (require_once $path);
            $fields = array_merge($fields, $fields2);
        }
    }
    $form->items($fields);
    return $form;
})->create(function ($id) {
    $form = AdminForm::tabbed();
    $fields = [];
    $fields['Main'] = [FormItem::columns()->columns([[FormItem::text('title', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::timestamp('publish', 'Дата и время публикации')->defaultValue(Carbon\Carbon::now()), FormItem::timestamp('publish_end', 'Дата и время олкончания публикация')->defaultValue(Carbon\Carbon::now()), FormItem::text('redirect', 'Редирект'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('alias', 'Алиас')->unique(), FormItem::text('name', 'Название')->required()->unique(), FormItem::image('image', 'Картинка')]])];
    $form->items($fields);
    return $form;
});
开发者ID:larabox,项目名称:larabox,代码行数:30,代码来源:Landeng.php

示例14:

<?php

Admin::model('App\\Models\\Product')->title('')->display(function () {
    $display = AdminDisplay::datatables();
    $display->with();
    $display->filters([]);
    $display->columns([Column::string('title')->label('Title'), Column::image('image')->label('Title'), Column::string('m_desc')->label('Description'), Column::string('price')->label('Price'), Column::string('discount')->label('Discount'), Column::custom()->label('Active')->callback(function ($instance) {
        return $instance->active ? '&check;' : '-';
    })]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('title', 'Title')->required(), FormItem::text('slug', 'Slug')->required(), FormItem::text('m_desc', 'Mini Description')->required(), FormItem::ckeditor('f_desc', 'Full Description')->required(), FormItem::image('image', 'Image')->required(), FormItem::select('server_id', 'Server')->model('App\\Models\\Server')->display('name')->required(), FormItem::text('command', 'Command')->required(), FormItem::text('price', 'Price')->required(), FormItem::text('discount', 'Discount')->defaultValue(0)->required()->validationRule(['numeric', 'max:99']), FormItem::checkbox('countable', 'Countable'), FormItem::checkbox('active', 'Active')]);
    return $form;
});
开发者ID:proudly,项目名称:RefEng,代码行数:15,代码来源:Product.php

示例15: strlen

    $display = AdminDisplay::tabbed();
    $display->tabs(function () {
        $tabs = [];
        $columns = [Column::string('title')->label('Title'), Column::datetime('date')->label('Date')->format('d.m.Y'), Column::custom()->label('Published')->callback(function ($instance) {
            return $instance->published ? '&check;' : '-';
        })];
        $main = AdminDisplay::table();
        $main->columns($columns);
        $tabs[] = AdminDisplay::tab($main)->label('Main')->active(true);
        $withScope = AdminDisplay::table();
        $withScope->scope('last');
        $withScope->columns($columns);
        $tabs[] = AdminDisplay::tab($withScope)->label('With Scope');
        $otherColumns = AdminDisplay::table();
        $otherColumns->apply(function ($query) {
            $query->orderBy('title', 'asc');
        });
        $otherColumns->columns([Column::string('title')->label('Title'), Column::custom()->label('Title Length')->callback(function ($instance) {
            return strlen($instance->title);
        })]);
        $tabs[] = AdminDisplay::tab($otherColumns)->label('Other Columns and Order');
        $otherDisplay = Admin::model('App\\Page')->display();
        $tabs[] = AdminDisplay::tab($otherDisplay)->label('Display from Other Model');
        return $tabs;
    });
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('title', 'Title')->required(), FormItem::date('date', 'Date')->required()->format('d.m.Y'), FormItem::checkbox('published', 'Published'), FormItem::ckeditor('text', 'Text')]);
    return $form;
});
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:31,代码来源:News3.php


注:本文中的Column::custom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。