<?php Admin::model(App\TimeSlot::class)->title('Time Slots')->with()->filters(function () { })->columns(function () { Column::string('id', 'ID'); Column::date('start', 'Start')->format('none', 'short'); Column::date('end', 'End')->format('none', 'short'); Column::earlyLate('type', 'Type'); })->form(function () { FormItem::time('start', 'Start')->required(); FormItem::time('end', 'End')->required(); FormItem::select('type', 'Type')->list([1 => 'Early', 0 => 'Late']); });
<?php //dd(Storage::files('archivos-imprentas')); Admin::model(\App\Orden::class)->title('Ordenes')->with()->filters(function () { })->columns(function () { Column::string('numero_de_orden', 'Numero de orden'); Column::date('valido_hasta', 'Valido Hasta')->format('medium', 'none'); Column::string('imprenta.nombre', 'Imprenta'); Column::Link('codigo', 'URL')->sortable(false); Column::action('email', 'email')->icon('fa-envelope-o')->style('short')->callback(function ($instance) { $imprenta = $instance->imprenta; Mail::send('email', ['imprenta' => $imprenta, 'orden' => $instance], function ($m) use($instance, $imprenta) { $m->from('*****@*****.**', 'Muriel Lodeiro'); $m->to($imprenta->email, $imprenta->contacto)->subject('Archivos disponibles para orden de compra: ' . $instance->numero_de_orden); }); //return Redirect::route('my-route', [$instance->id]); }); })->form(function () { FormItem::text('numero_de_orden', 'Numero De Orden'); FormItem::select('imprenta_id', 'Imprenta')->list(App\Imprenta::class); FormItem::date('valido_hasta', 'Valido Hasta'); FormItem::textarea('comentarios', 'Comentarios'); FormItem::archivosSelector('archivos_s', 'Archivos'); FormItem::archivosHidden('archivos', ''); });
<?php // Invoices Admin::model('\\App\\Subscription')->title('Subscriptions')->as('subscriptions')->with('user')->with('invoice')->denyCreating(function () { // Deny creating on thursday return false; })->denyEditingAndDeleting(function ($instance) { // deny editing and deleting rows when this is true return false; })->filters(function () { //ModelItem::filter('user_id')->name()->from('\User'); })->columns(function () { // Describing columns for table view Column::string('user.name', 'User'); Column::string('invoice.description', 'Invoice'); Column::date('start_date', 'Start Date'); Column::date('end_date', 'End Date'); Column::date('created_at', 'Created'); })->form(function () { FormItem::select('user_id', 'Users')->list(\App\User::class); FormItem::select('invoice_id', 'Invoices')->list(\App\Invoice::class); FormItem::date('start_date', 'Start Date'); FormItem::date('end_date', 'End Date'); });
<?php Admin::model(\App\Models\News::class)->title('News')->with()->filters(function () { })->columns(function () { Column::string('title', 'Title'); Column::date('date', 'Date')->format('medium', 'none'); Column::string('published', 'Published'); // Column::string('text', 'Text'); Column::image('photo', 'Photo')->sortable(false); })->form(function () { FormItem::text('title', 'Title')->required(); FormItem::date('date', 'Date')->required(); FormItem::checkbox('published', 'Published')->required(); FormItem::image('photo', 'Photo'); FormItem::ckeditor('text', 'Text')->required(); });
<?php Admin::model(\Pages::class)->title('Страницы')->with()->filters(function () { })->columns(function () { Column::string('id', 'ID'); Column::string('menu_title', 'Заголовок меню'); Column::string('title', 'Заголовок'); Column::string('is_published', 'Статус публикации'); Column::date('created_at', 'Дата создания')->format('medium', 'short'); Column::date('updated_at', 'Дата обновления')->format('medium', 'short'); Column::date('published_at', 'Дата публикации')->format('medium', 'short'); })->form(function () { // FormItem::select('parent_id', 'Родитель')->enum(Pages::whereIsContainer(1)->lists('menu_title', 'id')); FormItem::text('parent_id', 'Родитель'); FormItem::checkbox('is_published', 'Опубликовано'); FormItem::checkbox('is_container', 'Может быть родителем'); //FormItem::text('position', 'Позиция в меню'); FormItem::text('alias', 'Алиас'); FormItem::text('menu_title', 'Заголовок меню'); FormItem::text('title', 'Заголовок'); FormItem::timestamp('published_at', 'Дата публикации'); //->seconds(true); FormItem::textarea('meta_title', 'Мета-тег Title')->attributes(['rows' => 4]); FormItem::textarea('meta_desc', 'Мета-тег Description')->attributes(['rows' => 4]); FormItem::textarea('meta_key', 'Мета-тег Keywords')->attributes(['rows' => 4]); FormItem::ckeditor('introtext', 'Краткое описание'); FormItem::ckeditor('content', 'Контент'); });
<?php Admin::model(\App\Curriculum::class)->title('Curriculum')->with()->filters(function () { })->columns(function () { Column::string('apellido', 'Apellido'); Column::string('nombre', 'Nombre'); Column::string('puesto', 'Puesto'); Column::string('edad', 'Edad'); Column::string('email', 'e-mail'); Column::date('created_at', 'Ingreso'); })->form(function () { FormItem::text('nombre', 'nombre'); FormItem::text('apellido', 'apellido'); FormItem::text('dni', 'dni'); FormItem::text('fecha_nacimiento', 'fecha_nacimiento'); FormItem::text('puesto', 'puesto'); FormItem::text('domicilio', 'domicilio'); FormItem::text('localidad', 'localidad'); FormItem::text('provincia', 'provincia'); FormItem::text('telefono', 'telefono'); FormItem::text('email', 'email'); FormItem::text('linkedin', 'linkedin'); FormItem::CustomCV(); });
<?php Admin::model(\Contact::class)->title('Почта')->with()->filters(function () { })->columns(function () { Column::string('ip', 'Ip'); Column::string('name', 'Имя'); Column::string('email', 'Email'); Column::string('phone', 'Телефон'); Column::date('created_at', 'Дата создания')->format('medium', 'short'); // Column::date('updated_at', 'Дата обновления')->format('medium', 'short'); Column::date('read_at', 'Дата прочтения')->format('medium', 'short'); })->form(function () { FormItem::text('name', 'Имя'); FormItem::text('email', 'Email'); FormItem::text('phone', 'Телефон'); FormItem::ckeditor('message', 'Текст письма'); });
<?php Admin::model(App\Document::class)->title('Document')->with()->filters(function () { })->columns(function () { Column::string('state', 'Status'); Column::string('description', 'Description'); Column::string('amount', 'Amount'); Column::date('due', 'Due On'); Column::string('ref_id', 'Ref. ID'); Column::string('ref_status', 'Ref. Status'); })->form(function () { FormItem::text('state', 'Status'); FormItem::text('description', 'Description'); FormItem::text('amount', 'Amount'); FormItem::date('due', 'Due On'); FormItem::text('ref_id', 'Ref. ID'); FormItem::text('ref_status', 'Ref. Status'); });
<?php Admin::model(App\Day::class)->title('Days')->with()->filters(function () { })->columns(function () { Column::string('id', 'ID'); Column::date('date', 'Date')->formatDate('short'); Column::yesNo('weekend', 'Weekend'); Column::active('status', 'Status')->append(Column::filter('status')->value('status')); })->form(function () { FormItem::date('date', 'Date')->required()->unique(); FormItem::checkbox('weekend', 'Weekend?')->required(); FormItem::checkbox('status', 'Active?')->required(); });
<?php Admin::model('\\Contact')->title('Contacts')->with('country', 'companies')->filters(function () { ModelItem::filter('country_id')->title()->from('\\Country'); ModelItem::filter('withoutCompanies')->scope('withoutCompanies')->title('without companies'); })->columns(function () { Column::image('photo'); Column::string('full_name', 'Name')->orderBy('lastName')->sortableDefault(); Column::date('birthday', 'Birthday')->format('medium', 'none'); Column::string('country.title', 'Country')->append(Column::filter('country_id')->value('country.id')); Column::lists('companies.title', 'Companies'); Column::action('show', 'Custom action')->target('_blank')->icon('fa-globe')->style('long')->callback(function ($instance) { echo 'You are trying to call custom action "show" with row id "' . $instance->id . '"'; die; }); })->form(function () { FormItem::text('firstName', 'First Name')->required(); FormItem::text('lastName', 'Last Name')->required(); FormItem::image('photo', 'Photo'); FormItem::date('birthday', 'Birthday'); FormItem::text('phone', 'Phone'); FormItem::text('address', 'Address'); FormItem::select('country_id', 'Country')->list('\\Country')->required(); FormItem::multiSelect('companies', 'Companies')->list('\\Company')->value('companies.company_id'); FormItem::ckeditor('comment', 'Comment'); FormItem::view('admin.form.comment'); });
<?php // Invoices Admin::model('\\App\\Administrator')->title('Administrators')->as('administrators')->denyCreating(function () { // Deny creating on thursday return false; })->denyEditingAndDeleting(function ($instance) { // deny editing and deleting rows when this is true return false; })->columns(function () { // Describing columns for table view Column::string('username', 'Username'); Column::date('created_at', 'Created'); Column::date('updated_at', 'Updated'); })->form(function () { // Describing elements in create and editing forms FormItem::text('username', 'Username'); FormItem::password('password', 'Password'); });