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


PHP Column::order方法代码示例

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


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

示例1:

<?php

\Admin::model('App\\LandingBlocks')->title('Landing blocks')->alias('landing-blocks')->display(function () {
    $display = AdminDisplay::table();
    $display->apply(function ($query) {
        $query->orderBy('order', 'ASC');
    });
    $display->columns([Column::checkbox(), Column::string('id')->label('#'), Column::string('label')->label('Загаловок'), Column::order()]);
    return $display;
})->edit(function ($id) {
    $form = AdminForm::tabbed();
    $fields = [];
    $fields['Main'] = [FormItem::columns()->columns([[FormItem::text('label', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание'), FormItem::text('class', 'Класс'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('name', 'Имя блока')->required(), FormItem::text('landing_id', 'Landing')]])];
    $model = App\LandingBlocks::find($id);
    if ($model) {
        $path = base_path('App' . DIRECTORY_SEPARATOR . 'AdminLanding' . DIRECTORY_SEPARATOR . str_replace('.', DIRECTORY_SEPARATOR, $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('label', 'Загаловок')->required()->unique(), FormItem::textarea('description', 'Описание')->required(), FormItem::text('class', 'Класс'), FormItem::icheckbox('active', 'Статус')->defaultValue(true)], [FormItem::text('name', 'Имя блока')->required(), FormItem::text('landing_id', 'Landing')]])];
    $form->items($fields);
    return $form;
});
开发者ID:larabox,项目名称:larabox,代码行数:30,代码来源:LandingBlocks.php

示例2: use

<?php

/** @var \SleepingOwl\Admin\Model\ModelConfiguration $model */
$model = Admin::model(\App\HistoryDate::class);
$model->title('История – даты');
$model->display(function () {
    $display = AdminDisplay::datatables();
    $display->columns([Column::checkbox(), Column::string('title')->label('Заголовок')->orderable(false), Column::string('description')->label('Описание')->orderable(false), Column::count('events')->label('Событий')->orderable(false), Column::datetime('created_at')->label('Создан')->format('d.m.Y в H:i')->orderable(false), Column::order()->orderable(false)]);
    $display->order([[5, 'asc']]);
    $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', 'Заголовок')->required(), FormItem::text('description', 'Описание')]);
    return $form;
});
开发者ID:stcoder,项目名称:uf-vova,代码行数:19,代码来源:HistoryDates.php

示例3:

<?php

Admin::model('App\\Country')->title('Countries (orderable)')->display(function () {
    $display = AdminDisplay::table();
    $display->apply(function ($query) {
        $query->orderBy('order', 'asc');
    });
    $display->columns([Column::string('title')->label('Title'), Column::count('contacts')->label('Contacts')->append(Column::filter('country_id')->model('App\\Contact')), Column::order()]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('title', 'Title')->required()->unique()]);
    return $form;
});
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:14,代码来源:Country.php

示例4: use

<?php

/** @var \SleepingOwl\Admin\Model\ModelConfiguration $mdenu */
$model = Admin::model(\App\ScheduleAndCost::class);
$model->title('Блок расписание и стоимость');
$model->display(function () {
    $display = AdminDisplay::datatables();
    $display->columns([Column::string('title')->label('Заголовок')->orderable(false), Column::datetime('created_at')->label('Создан')->orderable(false), Column::order()->orderable(false)]);
    $display->apply(function (\Illuminate\Database\Eloquent\Builder $query) {
        $query->withTrashed();
        $query->orderBy('order', 'asc');
    });
    return $display;
})->createAndEdit(function ($id) use($model) {
    $model->title($id ? 'Редактировать блок' : 'Создать блок');
    $form = AdminForm::form();
    $form->items([FormItem::text('title'), FormItem::ckeditor('text')]);
    return $form;
});
开发者ID:stcoder,项目名称:uf-vova,代码行数:19,代码来源:ScheduleAndCost.php

示例5: use

<?php

/**
 * @var \SleepingOwl\Admin\Model\ModelConfiguration
 */
$model = Admin::model(\App\Slide::class);
$model->title('Слайды');
$model->display(function () {
    $display = AdminDisplay::datatables();
    $display->with('page');
    $display->columns([Column::image('image')->label('Картинка')->orderable(false), Column::string('title')->label('Заголовок')->orderable(false), Column::string('description')->label('Описание')->orderable(false), Column::string('page.title')->label('Страница')->append(Column::filter('id')->model(\App\Page::class)->field('page_id'))->orderable(false), Column::order()->orderable(false)]);
    $display->apply(function ($query) {
        $query->orderBy('sort', 'asc');
    });
    return $display;
});
$model->createAndEdit(function ($id) use($model) {
    $model->title($id ? 'Редактировать слайд' : 'Создать слайд');
    $form = AdminForm::form();
    $form->items([FormItem::columns()->columns([[FormItem::text('title', 'Заголовок')->required(), FormItem::select('page_id', 'Страница')->model(\App\Page::class)->display('title')->required(), FormItem::textarea('description', 'Описание')->rows(4)], [FormItem::image('image', 'Картинка')->required(true)]])]);
    return $form;
});
开发者ID:stcoder,项目名称:uf-vova,代码行数:22,代码来源:Slide.php

示例6:

<?php

Admin::model('App\\Category')->title('Categorias')->display(function () {
    $display = AdminDisplay::table();
    $display->apply(function ($query) {
        $query->orderBy('order', 'asc');
    });
    $display->columns([Column::string('name')->label('Nombre'), Column::count('products')->label('Productos'), Column::order()]);
    return $display;
})->createAndEdit(function () {
    $form = AdminForm::form();
    $form->items([FormItem::text('name', 'Nombre'), FormItem::image('banner', 'Banner'), FormItem::ckeditor('description', 'Descripcion')]);
    return $form;
});
开发者ID:avilaj,项目名称:ocsport,代码行数:14,代码来源:Category.php


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