-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration of Column::data does not compatible with Fluent::data #229
Comments
@yajra Can you please quickly look into this, this looks like very recently occurred. Here https://github.com/laravel/framework/blame/11.x/src/Illuminate/Support/Fluent.php#L116 18 hours ago Please help us asap |
Please help us asap |
The issue was due to a recent update in the Fluent class via laravel/framework#53665. We will have to wait for it to be reverted or not before we make changes. |
@yajra This can be fixed by simply making the definition compatible and overriding the visibility: class Column extends Fluent
{
// ...
public function data(mixed $value, mixed $default = null): static
{
$this->attributes['data'] = $value;
return $this;
}
} |
@stevebauman Yes, it is the quickest solution as discussed in yajra/laravel-datatables#3201. But some devs might not like that idea. |
For some releases, what if we stick with the current approach but add a deprecation warning?
|
I designed the Column builder to match the So it's a NO for me to go with deprecation. Thanks! |
You have been managing this great package for a long time, so you have a better understanding of its usability. I have one short of suggestions that, We can remove the deprecation notice and use PHP DOC to notify the user about the logic update. However, we can make a new method that the user can directly use, like setData. And current, data method, which will redirect to parent if both arguments are provided. otherwise, it will be called setData internally. |
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:
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:
The text was updated successfully, but these errors were encountered: