@Snapey .
Using your solution i get the following error:
"Undefined variable: user".
I have tried different approaches to this problem, until now I have no good results.
I believe the following approach is the easier one.
Start by getting the task_id's where status is equal to the desired status. Then, use those task_id's to get the task data.
$inprogress = Taskinteraction::where('status','=','Unassigned')->get();
Echo $inprogress will return a collection, like this this:
[{"id":6,"task_id":47,"status":"Unassigned","comments":null,"created_at":"2017-04-28 13:18:13"},{"id":7,"task_id":48,"status":"Unassigned","comments":null,"created_at":"2017-04-28 13:20:09"},{"id":8,"task_id":49,"status":"Unassigned","comments":null,"created_at":"2017-04-28 13:24:38"}]
But, I only need the task_id, to be correct I only need an array of task_id’s to use in something like this:
$tasksinprogress = Task::where('assigned_to','=',auth::id())->whereIn('id', $inprogress)->get();
How do I extract the task_id property from this array of objects?
Another question: How do i query the table task_interactions to get the same result as the following query:
SELECT task_id FROM schema.task_interactions WHERE status = 'Unassigned';