Eloquent: Query the length of field in Laravel
Use whereRaw
:
User::with('Permissons')->whereRaw('LENGTH(name) > ?', [50])->get();
Try this
whereRaw( string $sql, array $bindings = array(), string $boolean = 'and')
User::with('Permissons')->whereRaw('LENGTH(name) > 50')->get();