Skip to content
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

Is feature available for Laravel Api Resources on this data table? #1659

Closed
pralhadstha opened this issue Mar 15, 2018 · 3 comments
Closed

Comments

@pralhadstha
Copy link

pralhadstha commented Mar 15, 2018

Summary of problem or feature request

Is there any future feature / way to implement the default laravel's api resources in this datatable?
https://laravel.com/docs/5.6/eloquent-resources

I can see it uses the league/fractal but it would be great if we could implement the default one from laravel which could decrease a dependency and we could use common way to implement the api output for other api's and the data table api response.

Code snippet of problem

 return DataTables::eloquent(User::query())
            ->setTransformer(new UserResources(User::query()))
            ->toJson();

-->

System details

  • Operating System Windows | linux
  • PHP Version 7.0 | 5.6
  • Laravel Version 5.5 and up
  • Laravel-Datatables Version 8+

Edit:

I can also see the one issue on #1515 but still that doesn't have a correct work around to use the Api Resources. Is there any way to implement the resources api rather than using collection?

Any help will be appreciated.

@yajra
Copy link
Owner

yajra commented Mar 28, 2018

Sorry, but haven't got the time to implement a support for it. A bit busy on non open source projects.

@yajra
Copy link
Owner

yajra commented May 10, 2018

Fixed on #1702

@yajra yajra closed this as completed May 10, 2018
@khaderDevloper
Copy link

khaderDevloper commented Apr 25, 2021

You'll need to install laravel-datatables-fractal package if you haven't already.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants