8000 Remove expression usage for Laravel 10 compatibility by dmason30 · Pull Request #152 · coroo/nova-chartjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove expression usage for Laravel 10 compatibility #152

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

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

dmason30
Copy link
Contributor

Fixes #151

I have removed the DB::raw usage for setting the $xAxisColumn as it seems completely unnecessary to do this.

Cause

From the Laravel 10 upgrade guide:
https://laravel.com/docs/10.x/upgrade#database-expressions

Database "expressions" (typically generated via DB::raw) have been rewritten in Laravel 10.x to offer additional functionality in the future. Notably, the grammar's raw string value must now be retrieved via the expression's getValue(Grammar $grammar) method. Casting an expression to a string using (string) is no longer supported.

Typically, this does not affect end-user applications; however, if your application is manually casting database expressions to strings using (string) or invoking the __toString method on the expression directly, you should update your code to invoke the getValue method instead:

use Illuminate\Support\Facades\DB;

$expression = DB::raw('select 1');

$string = $expression->getValue(DB::connection()->getQueryGrammar());

@Jonnx
Copy link
Jonnx commented Mar 20, 2023

any prospect of getting this fix in anytime soon?

@Jonnx
Copy link
Jonnx commented Mar 22, 2023

Been running this fork in prod. Works solid. Once this is merged I will open a PR from my fork that includes an AVG calculation, not just sum. Really helpful when visualizing internal ratings

@coroo coroo merged commit 2ead394 into coroo:master Aug 16, 2023
@coroo
Copy link
Owner
coroo commented Aug 16, 2023

Thank you for the contribution @dmason30 @Jonnx , I've release it at version 0.4.1 https://github.com/coroo/nova-chartjs/releases/tag/v0.4.1

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

Successfully merging this pull request may close these issues.

Laravel 10 Compatibility?
3 participants
0