Skip to content

Passing callable classes to addColumn #2976

@recursivetree

Description

@recursivetree

Summary of problem or feature request

After upgrading our app to laravel-datatables 9.21 and above, you can't pass a class implementing __invoke() to addColumn. While this has never been supported according to the docs, it has worked until now.

In our project, we used this to share common columns across multiple tables.

Code snippet of problem

This is the context where the issue arises for us.
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Character/Intel/Assets/DataTable.php#L120
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php#L95
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Common/IColumn.php
https://github.com/eveseat/web/blob/master/src/Http/DataTables/Character/Intel/Assets/Columns/Owner.php

Commits introducing the problem

3e6846a
4f2db32

Instead of allowing everything that's callable, only Closures are passed through. It should be an easy fix to allow everything callable again.

System details

  • Operating System docker containers on mac os
  • PHP Version 8.1
  • Laravel Version 10
  • Laravel-Datatables Version >= 9.21

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