jeudi 2 mars 2017

Query only records that match specific substring - Laravel 5

I would like to query my visitors records from my visitors table that has the the OS substring of bot.

enter image description here

As you can see, there are 3 of 8 records listed here right now. I just want to grab those 3.

I tried look in here http://ift.tt/2mPTBqR

I didn't really what I am looking to do there, unless I missed it.

$visitors = Visitor::orderBy('created_at', 'desc')
        ->where('os',substr('bot'))<----- NEED help here 
        ->get();

Any hints / suggestions on this will be much appreciated !



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire