Tuesday, February 28, 2017

Laravel, pimpable. filter request by null

In my DB table I have column 'deleted_at'. If I delete the model, the value of 'deleted_at' is the date & time of deleting. In other case the value is NULL.

Now I want get all rows, those have 'deleted_at=NULL' (existing models).

This query works perfect, it returns all deleted models (where deleted_at is not null)

$result = SearchContract::pimp(['deleted_at' => '!null'])->paginate($limit)->toArray();

So I need the rows where 'deleted_at = NULL'.

We use the Pimpable librari, here is the link [http://ift.tt/2m1yh4u]




via Гарик Мкртчян

Advertisement