Laravel where null


DB::table(‘table_name’)->whereNull(‘column_name’)->get(); is used for where Null condition in laravel.


Laravel where null clause Example

We are going to fetch data with whereNull clause in laravel from the table emp.

DB::table('emp')->whereNUll('manager_name')->get();

Will Generate query like this.

//Select * from emp where manager_name IS NUll ;


Advertisements

Add Comment

📖 Read More