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/inventory.corals.io/Corals/modules/Payment/Common/DataTables/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/inventory.corals.io/Corals/modules/Payment/Common/DataTables/CurrenciesDataTable.php
<?php

namespace Corals\Modules\Payment\Common\DataTables;

use Corals\Foundation\DataTables\BaseDataTable;
use Corals\Modules\Payment\Facades\Payments;
use Corals\Modules\Payment\Common\Models\Currency;
use Corals\Modules\Payment\Common\Transformers\CurrencyTransformer;
use Yajra\DataTables\EloquentDataTable;

class CurrenciesDataTable extends BaseDataTable
{


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

        $dataTable = new EloquentDataTable($query);

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

    public function query(currency $model)
    {
        return $model->newQuery();
    }


    protected function getColumns()
    {
        return [
            'id' => ['visible' => false],
            'name' => ['title' => trans('Payment::attributes.currency.name')],
            'code' => ['title' => trans('Payment::attributes.currency.code')],
            'symbol' => ['title' => trans('Payment::attributes.currency.symbol')],
            'format' => ['title' => trans('Payment::attributes.currency.format')],
            'active' => ['title' => trans('Corals::attributes.status_options.active')],
            'exchange_rate' => ['title' => trans('Payment::attributes.currency.exchange_rate')],
            'created_at' => ['title' => trans('Corals::attributes.created_at')],
            'updated_at' => ['title' => trans('Corals::attributes.updated_at')]
        ];
    }

    public function getFilters()
    {
        return [
            'name' => ['title' => trans('Payment::attributes.currency.name'), 'class' => 'col-md-3', 'type' => 'text', 'condition' => 'like', 'active' => true],
            'code' => ['title' => trans('Payment::attributes.currency.code'), 'class' => 'col-md-2', 'type' => 'select', 'options' => Payments::getCodeList(), 'active' => true],
        ];
    }


    protected function getBuilderParameters()
    {
        return ['order' => [5, 'desc']];
    }

    protected function getBulkActions()
    {
        return [
            'active' => ['title' => '<i class="fa fa-check-circle"></i> ' . trans('Corals::attributes.status_options.active'), 'permission' => 'Payment::currency.update', 'confirmation' => trans('Corals::labels.confirmation.title')],
            'inactive' => ['title' => '<i class="fa fa-check-circle-o"></i> ' .  trans('Corals::attributes.status_options.inactive'), 'permission' => 'Payment::currency.update', 'confirmation' => trans('Corals::labels.confirmation.title')],
        ];
    }

    protected function getOptions()
    {
        $url = url(config('payment_common.models.currency.resource_url'));
        return ['resource_url' => $url];
    }


}

Spamworldpro Mini