item = $item; $this->request = $this->getRequestInstance($request); } /** * Execute the job. * * @return Item */ public function handle() { \DB::transaction(function () { $this->item->update($this->request->all()); // Upload picture if ($this->request->file('picture')) { $media = $this->getMedia($this->request->file('picture'), 'items'); $this->item->attachMedia($media, 'picture'); } }); return $this->item; } }