Skip to content

Declaration of Column::data does not compatible with Fluent::data #3201

@fdteam-deanie

Description

@fdteam-deanie

Summary of problem or feature request

Error

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

File vendor/yajra/laravel-datatables-html/src/Html/Column.php, function data (line 305 - 310) was the reason:

    public function data(array|string $value): static
    {
        $this->attributes['data'] = $value;

        return $this;
    }

System details

  • Operating System: Mac OS 15
  • PHP Version: 8.3
  • Laravel Version: laravel/framework ^11.34
  • Laravel-Datatables Version: yajra/laravel-datatables ^11.0

Solution

File vendor/yajra/laravel-datatables-html/src/Html/Column.php, change function data (line 305 - 310) to:

    public function data($key = null, $default = null): static
    {
        $this->attributes['data'] = $key;

        return $this;
    }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions