I have two tables Leads and Tasks, I need to fetch all leads by checking one specific column in the tasks table.
Laravel Mysql
Relation on Lead Model
public function tasks()
{
return $this->hasMany(Task::class, 'lead_id', 'id');
}
*need to list all leads which create_task_id != 2 (tasks table)