Skip to content

[Bug] Column::data() method signature incompatible with Illuminate\Support\Fluent in Laravel 11 #3209

@FahriDarmawan

Description

@FahriDarmawan

Summary of problem or feature request

Declaration of Yajra\DataTables\Html\Column::data() method signature incompatibility with Laravel 11. The error occurs when using Column class in DataTables with Laravel 11 and Yajra DataTables 11.0.

image
Declaration of Yajra\DataTables\Html\Column::data(array|string $value): static must be compatible with Illuminate\Support\Fluent::data($key = null, $default = null)

Code snippet of problem

<?php

namespace App\DataTables\MasterData;

use App\Models\Master\MasterTahunSk;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;

class MasterTahunSkDataTable extends DataTable
{
   public function getColumns(): array
   {
       return [
           Column::make('DT_RowIndex')
               ->title('No')
               ->orderable(false)
               ->searchable(false)
               ->width(60)
               ->addClass('text-center'),
           Column::make('tahun'),
           Column::make('keterangan'),
           Column::make('biaya_daftar_ulang'),
           Column::computed('action')
               ->exportable(false)
               ->printable(false),
       ];
   }
}

System details

  • Operating System: Windows 11
  • PHP Version: 8.2
  • Laravel Version: 11.36.1
  • Laravel-Datatables Version: 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions