yajra / laravel-datatables

jQuery DataTables API for Laravel

Home Page:https://yajrabox.com/docs/laravel-datatables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ionCube 503 service unavailable

CyberDepot opened this issue · comments

i use metrinic for my laravel project and finally i want release my product, i use ioncube 12.0.2 for encrypt controllers and models but i have error 503, i trace my app and i found out only on index files have this error and i use DataTable on this functions

Controller

    public function index(BanksDataTable $dataTable){
        return $dataTable->render('basic-information.banks.index');
    }

Yajra DataTable

<?php
namespace App\DataTables;

use App\Core\LIMSHelper;
use App\Models\Bank;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;

class BanksDataTable extends DataTable{
    public function dataTable($query){
        return (new EloquentDataTable($query))
            ->addIndexColumn()
            ->editColumn('created_at', function ($data){
                $date = LIMSHelper::LocalDatePicker($data->created_at, 'Y/m/d H:i');
                return '<span class="ltr d-inline-flex">' . $date . '</span>';
            })
            ->editColumn('updated_at', function ($data){
                $date = LIMSHelper::LocalDatePicker($data->updated_at, 'Y/m/d H:i');
                return '<span class="ltr d-inline-flex">' . $date . '</span>';
            })
            ->addColumn('action', function ($data){
                return $this->actionButtons($data->id);
            })
            ->setRowId('id');
    }

    public function query(Bank $model){
        return $model->business();
    }

    public function html(){
        return $this->builder()
            ->setTableId('banks-table')
            ->columns($this->getColumns())
            ->postAjax();
    }

    protected function getColumns(){
        return [
            Column::make('DT_RowIndex')
                ->orderable(false)
                ->searchable(false)
                ->title(trans('app.table ROW')),

            Column::make('bank_name')
                ->title(trans('app.Bank title'))
                ->addClass('text-start'),

            Column::make('account_holder')
                ->title(trans('app.account number'))
                ->addClass('text-start'),

            Column::make('account_number')
                ->title(trans('app.account holder'))
                ->addClass('none'),

            Column::make('account_card_number')
                ->title(trans('app.card number'))
                ->addClass('none'),

            Column::make('account_iban_number')
                ->title(trans('app.iban number'))
                ->addClass('none'),

            Column::make('created_at')
                ->title(trans('app.created at'))
                ->addClass('nowrap'),

            Column::make('updated_at')
                ->title(trans('app.updated at'))
                ->addClass('nowrap'),

            Column::computed('action', trans('app.action'))
                ->titleAttr('action')
                ->addClass('text-nowrap'),
        ];
    }

    protected function actionButtons($id){
        $edit_url = route('banks.edit', $id);
        $delete_url = route('banks.destroy', $id);

        $edit_caption = trans('app.edit');
        $delete_caption = trans('app.delete');

        $authUser = auth()->user();

        $btn_edit = "<div class='btn btn-light-dark btn-circle mx-1'><i class='fas fa-edit p-0'></i></div>";
        $btn_delete = "<div class='btn btn-light-dark btn-circle mx-1'><i class='fas fa-trash p-0'></i></div>";

        if($authUser->can('edit banks'))
            $btn_edit = "<a href='$edit_url' class='btn btn-primary btn-circle mx-1' data-toggle='tooltip' data-placement='top' title='$edit_caption'><i class='fas fa-edit p-0'></i></a>";

        if($authUser->can('delete banks'))
            $btn_delete = "<a href='$delete_url' class='btn btn-danger btn-circle btn-delete-datatable mx-1' data-toggle='tooltip' data-placement='top' title='$delete_caption'><i class='fas fa-trash p-0'></i></a>";

        return $btn_edit . $btn_delete;
    }

    protected function filename(): string{
        return class_basename($this) . '_' . date('YmdHis');
    }
}

System details

  • CentOS 8
  • PHP 8.1
  • Laravel Version 9
  • yajra/laravel-datatables-buttons : "*",
  • yajra/laravel-datatables-oracle : "^10.1.3"

Apologies, I may not be able to help as I haven't tried ionCube yet. Please share if you found the solution. Thanks!

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue was closed because it has been inactive for 7 days since being marked as stale.