Support the ongoing development of Laravel.io →
Eloquent
Last updated 3 months ago.
0

@yongpin92,

you can use DB::raw method for this:

User::where(DB::raw("substr('name', 1, strpos('name', '_'))"), '=', 'kelvin');
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

yongpin92 yongpin92 yongpin92 Joined 10 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.