public function tableAssigned($workOrder)
    {
        $workOrder = $workOrder->whereHas('assignments', function (Builder $query) {
            $query->where('to_user_id', auth()->id());
        });

        return $this->table($workOrder);
    }
public function tableAssigned($workOrder)
    {
        $workOrder = $workOrder->whereHas('assignments', function (Builder $query) {
            $query->where('to_user_id', auth()->id());
        });

        return $this->table($workOrder);
    }
public function tableAssigned ( $ workOrder ) { $ workOrder = $ workOrder -> whereHas ( 'assignments' , function ( Builder $ query ) { $ query -> where ( 'to_user_id' , auth ( ) -> id ( ) ) ; } ) ; return $ this -> table ( $ workOrder ) ; }
Returns a new table of all work orders assigned to the current user.

@param WorkOrder|Builder $workOrder

@return Builder
Returns a new table of all work orders assigned to the current user .