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

[9.x] Add support for dependency injection when using closure. #2521

Merged
merged 4 commits into from
Jun 21, 2022
Merged

Conversation

yajra
Copy link
Owner

@yajra yajra commented Nov 18, 2020

This PR will add dependency injection support on closures like addColumn, editColumn, etc.

Before

->addColumn('status', function (Video $video) {
  return Livewire::mount('video-sync-poll', ['videoId' => $video->video_id])->html();
})

After

->addColumn('status', function (Video $video, LivewireManager $livewire) {
  return $livewire->mount('video-sync-poll', ['videoId' => $video->video_id])->html();
})

TODO

  • Add tests

@yajra yajra changed the title WIP: Add support for dependency injection when using closure. [9.x] Add support for dependency injection when using closure. Jun 21, 2022
@yajra yajra merged commit 3e6846a into 9.0 Jun 21, 2022
@yajra yajra deleted the closure-di branch June 21, 2022 13:29
yajra added a commit that referenced this pull request Jun 21, 2022
[9.x] Add support for dependency injection when using closure.

(cherry picked from commit 3e6846a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant