model = $model; } public function save(){ $this->general_file = GeneralFile::create([ 'travel_country_id' => $this->travel_country_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, 'filename' => $this->allowed_filename, 'file_id' =>$this->general_file->id, 'file_data' => $this->extension, 'file_icon' => $this->general_file->getIconExt(), 'file_format_bytes' => $this->general_file->formatBytes(), 'file_url' => $this->general_file->getURL(), 'redirect' => $this->redirect, 'code' => 200 ], 200); } }