Closed
Description
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: Linux Debian 12
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;
}