[viewBag] == no; $year = $this->year; $prodId = $this->prodId; $this["amount"] = Romanah\Gokbakja\Models\PivotProduction::where('product_id', $prodId) ->whereMonth('created_at', $no) ->whereYear('created_at', $year) ->where('deleted_at', null) ->avg('amount'); } ?> ==