wherenotnull laravel eloquent code example

Example 1: laravel query not null

DB::table('users')	->whereNotNull('name')	->get();

Example 2: larave whereNotNull

# whereNull
$users = DB::table('users')
  ->whereNull('updated_at')
  ->get();
# whereNotNull
$users = DB::table('users')
  ->whereNotNull('updated_at')
  ->get();

Example 3: check if value is not null in db laravel

Model::whereNotNull('sent_at')

Example 4: DB::table('users')->get();

DB::select('SELECT * FROM users WHERE name = ?', array(Input::get('name')));

Tags:

Php Example