Skip to content

$dataTable->with() does not allow collections to be passed. #154

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

Closed
challgren opened this issue Sep 28, 2022 · 1 comment · Fixed by #155
Closed

$dataTable->with() does not allow collections to be passed. #154

challgren opened this issue Sep 28, 2022 · 1 comment · Fixed by #155

Comments

@challgren
Copy link
Contributor

Summary of problem or feature request

When version 9.0.0 was released you added more parameter typehints, https://github.com/yajra/laravel-datatables-buttons/blob/master/src/Services/DataTable.php#L688 was changed to only allow array|string|null as a value when it should have stayed as mixed in the docblock to conform with the View contract https://github.com/laravel/framework/blob/9.x/src/Illuminate/Contracts/View/View.php#L23

I would be willing to do a PR for this to implement the Illuminate\Contracts\View\View to make this more consistent with the Laravel framework.

Code snippet of problem

Details are above but as a Laravel user I would expect DataTables->with() to follow along with the View contract method and allow passing of objects and other types.

System details

  • Operating System: MacOS 12.6
  • PHP Version: 8.1.10
  • Laravel Version: Laravel 9.31.0
  • Laravel-DataTables Version: Started with 9.0.0 but running 9.0.10
@yajra
Copy link
Owner

yajra commented Sep 29, 2022

Thanks for reporting, looking forward to your PR.

@yajra yajra closed this as completed in #155 Oct 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants