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/dceprojects.corals.io/Corals/modules/Timesheet/DataTables/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/dceprojects.corals.io/Corals/modules/Timesheet/DataTables/JobsDataTable.php
<?php

namespace Corals\Modules\Timesheet\DataTables;

use Corals\Foundation\DataTables\BaseDataTable;
use Corals\Modules\Timesheet\DataTables\Scopes\EmployeeJobsScope;
use Corals\Modules\Timesheet\Models\Job;
use Corals\Modules\Timesheet\Transformers\JobTransformer;
use Yajra\DataTables\EloquentDataTable;

class JobsDataTable extends BaseDataTable
{

    public function __construct()
    {
        $this->addScope(new EmployeeJobsScope());

        parent::__construct();
    }

    public function dataTable($query)
    {
        $this->setResourceUrl(config('timesheet.models.job.resource_url'));

        $dataTable = new EloquentDataTable($query);

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

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

    /**
     * Get columns.
     *
     * @return array
     */
    protected function getColumns()
    {
        $columns = [
            'id' => ['visible' => false],
            'title' => ['title' => trans('Timesheet::attributes.job.title')],
            'number' => ['title' => trans('Timesheet::attributes.job.number')],
            'starts_at' => ['title' => trans('Timesheet::attributes.job.starts_at')],
            'ends_at' => ['title' => trans('Timesheet::attributes.job.ends_at')],
            'hours_per_employee' => ['title' => trans('Timesheet::attributes.job.hours_per_employee')],
            'departments' => ['title' => trans('Timesheet::attributes.job.department'), 'orderable' => false, 'searchable' => false],
            'updated_at' => ['title' => trans('Corals::attributes.updated_at')],
        ];

        return $columns;
    }

    public function getFilters()
    {
        $filters = [
            'title' => [
                'title' => trans('Timesheet::attributes.job.title'),
                'class' => 'col-md-4',
                'type' => 'text',
                'active' => true
            ],
            'number' => [
                'title' => trans('Timesheet::attributes.job.number'),
                'class' => 'col-md-4',
                'type' => 'text',
                'active' => true
            ],
        ];
        return $filters;
    }

}

Spamworldpro Mini