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

[PROPOSAL] Implement strict null comparison #151

Open
3 tasks done
bluec opened this issue Jun 8, 2022 · 0 comments
Open
3 tasks done

[PROPOSAL] Implement strict null comparison #151

bluec opened this issue Jun 8, 2022 · 0 comments

Comments

@bluec
Copy link

bluec commented Jun 8, 2022

Prerequisites

  • Able to reproduce the behaviour outside of your code, the problem is isolated to Laravel Excel.
  • Checked that your issue isn't already filed.
  • Checked if no PR was submitted that fixes this problem.

Versions

  • PHP version: 8.1
  • Laravel version: 8.83.8
  • Nova version: 3.32.0
  • Package version: Nova Excel 1.2.10 and Laravel Excel 3.1.40

Description

Can't enable strict null comparison

Steps to Reproduce

Two ways I have tried:

  1. Publish the config/excel.php from the underlying Laravel Excel package and change strict_null_comparison to true
  2. Overload the \Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel class with a new class that implements the WithStrictNullComparison concern

Expected behavior:

With strict null comparison enabled, zero values in the database should export as zeros.

Actual behavior:

Zero values in the database export as null (empty cells).

Additional Information

This isn't an issue with the underlying Laravel Excel package - it works there.

I initially thought this was a bug but actually looking at the code I think it is just not implemented in this package so I have changed this to a proposal. I think it's possible to overcome this by creating a custom action but this is quite cumbersome.

Would be nice to see this implemented in the Nova package because I think it's quite important especially when dealing with Boolean fields in Laravel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant