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

Fix format callback #438

Merged
merged 1 commit into from
Aug 25, 2021
Merged

Conversation

Majkie
Copy link
Contributor

@Majkie Majkie commented Aug 18, 2021

Related to Issue #381

Now this thing works properly and does not require parameter containing row value to be called $value.

Column::make('Thing')->format(fn ($thing) => view('components.show-thing', compact('thing'))

@rappasoft
Copy link
Owner

They are not in the correct order but I'll change it.

@rappasoft rappasoft added the Awaiting Next Release Currently merged into development awaiting a release to master label Aug 24, 2021
@rappasoft rappasoft mentioned this pull request Aug 25, 2021
@rappasoft rappasoft merged commit 816be90 into rappasoft:master Aug 25, 2021
@decantr
Copy link

decantr commented Sep 1, 2021

I might be missing something but does this change actually improve anything?

From my understanding, we now have to pass dummy arguments in place where we would usually just need one named argument before, for example accessing the $row property?

@OmarAbdelSamea
Copy link

I was using version 1.12 and after updating to 1.14 all tables with custom format failed because I was passing only $row it returned error that $row is null.

 ->format(function ($row) {
          return view('exampleDir.exampleFile', ['row' => $row]);
  }),

I had to pass dummy parameters to make it work.

 ->format(function ($value, $column, $row) { ... })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Next Release Currently merged into development awaiting a release to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants