Skip to content

Conversation

LukeTowers
Copy link
Contributor

@LukeTowers LukeTowers commented Sep 30, 2025

This fixes an issue caused by the removal of automatic casting of Expression objects to strings in Laravel 10.

$sql = DB::table('users')
        ->select('id')
        ->orderByRaw(DB::raw('length(name) desc'))
        ->toSql();

fails without this change.

Related: #48652

This fixes an issue caused by the removal of automatic casting of Expression objects to strings in Laravel 10.

$sql = DB::table('users')
        ->select('id')
        ->orderByRaw(DB::raw('length(name) desc'))
        ->toSql();

fails without this change.
@LukeTowers
Copy link
Contributor Author

Not sure why that one Windows test is failing. Is it flakey?

@taylorotwell
Copy link
Member

Re-running to see if it fails again.

@LukeTowers
Copy link
Contributor Author

Looks like it's good to go now @taylorotwell

@taylorotwell taylorotwell merged commit 620d6ab into laravel:12.x Sep 30, 2025
90 of 107 checks passed
@LukeTowers LukeTowers deleted the patch-1 branch September 30, 2025 19:12
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.

2 participants