The best way to apply casts automatically for route-model binding is to use the resolveUsing method on the route. This method allows you to specify a callback that will be called when the route is resolved. You can use this callback to apply the casts to the model before it is returned.
For example:
Route::get('clients/{client}', 'ClientController@show')->resolveUsing(function ($client) {
$client->rate = floatval($client->rate);
return $client;
});
This will apply the cast to the rate attribute before the model is returned.