Most of the time I use the DB::raw to use functions inside eloquent queries.
Something similar to #1, since by the time it gets to the db query the data has been validated many times so I'm not so concerned about injections by that time.
I'm using a model file instead of the DB::table, but the code is relatively the same.
You could PR something, just remember that eloquent supports several db types so it would need to be cross compatible.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community