Reverse query with similar - laravel eloquent or raw MySQL query

I have a table with user submitted links. Some links do not contain

`http://`

      

I want to list these records using the following query:

        $object = Related::whereHas( function($q)
                {
                $q->where('URL', 'like', 'http%');

                    })->get();

      

How do I cancel a request to receive them?

thank

+3


source to share


1 answer


You can probably use the operator not like

in this case:



$object = Related::whereHas( function($q)
{
    $q->where('URL', 'not like', 'http%');

)->get();

      

+10


source







All Articles