murilo
389
7
Laravel

Find Queries Where Between First Letters Start with *

Posted 1 year ago by murilo

I have a Question , I have a List of names , like this -

Alexander , Callum , Charles , Charlie , Charlie , Connor , Damian , Daniel , David , Ethan , George , Harry , Jack , Jake , James , James , James , Joe , John , Joseph , Kyle , Liam , Mason , Michael , Noah , Oliver , Oscar , Reece , Rhys , Richard , Robert , Thomas , Thomas , William 

and I want to GET all names between Letters -> A to D , need to show me this -

Alexander , Callum , Charles , Charlie , Charlie , Connor , Damian , Daniel , David 

How could I do it ?

something like this ->

     $query = User::select(['id', 'names' ]->whereBetween('name' , [ 'a%',  '%d'])   ->latest()->get();

Thanks

Please sign in or create an account to participate in this conversation.