I've been using Laravel for a project and using the Eloquent models to grab the model instances I need.
However, it doesn't look like there's a way to query for not null
values.
https://laravel.com/docs/5.4/eloquent#retrieving-models
Is there a way to do something like this, where I want to get all Flight
models where the ticket_id
is not null
?
$flight = App\Flight::where('ticket_id', '!=', null);
Try this
$flight = App\Flight::whereNotNull('ticket_id')->get();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With