model = $model; } public function save(){ $this->customer_file = CustomerFile::create([ 'customer_id' => $this->customer_id, 'customer_mail_id' => $this->customer_mail_id, 'identifier' => $this->identifier, 'filename' => $this->allowed_filename, 'dir' => $this->dir, 'original_name' => $this->originalName, 'ext' => $this->extension, 'mine' => $this->mine, 'size' => $this->size ]); } public function response(){ return Response::json([ 'error' => false, 'original_name' => $this->originalName, 'filename' => $this->allowed_filename, 'file_id' =>$this->customer_file->id, 'file_data' => $this->extension, 'file_icon' => $this->customer_file->getIconExt(), 'file_format_bytes' => $this->customer_file->formatBytes(), 'file_url' => $this->customer_file->getURL(), 'redirect' => '', 'code' => 200 ], 200); } }