The Laravel 10 documentation states that casting an expression to a string using (string) is no longer supported. However, it seems that the DB::raw() method still works as expected in queries.
If you want to follow the updated syntax, you can retrieve the raw string value of an expression using the getValue() method. Here's an example:
$expression = DB::raw('CONCAT(first_name, " ", last_name)');
$value = $expression->getValue(DB::getQueryGrammar());
In this example, $value will contain the raw string value of the expression, which is 'CONCAT(first_name, " ", last_name)'.
So, if you want to update your code to use the new syntax, you can replace DB::Raw() with DB::raw() and retrieve the raw string value using the getValue() method. However, if your existing code is working fine, you can continue to use it as is.