'System\Models\File', // 'file' => 'Tps\Shops\Classes\FileAttachment', ]; public $translatable = ['name']; // public function afterSave() // public function beforeSave() public function formAfterSave($model) { // $this->name = $this->file; $filePath = \System\Models\File::find($model->id)->getLocalPath(); // $filePath = Input::file('file')->getPath(); Log::error("FILE PATH IS ------------------------".$filePath); // throw new ApplicationException("FILE PATH IS ------------------------".$filePath); // App::abort(403, "FILE PATH IS ------------------------".$filePath); // $fileRecord = Input::file('file'); // $fileRecord = \System\Models\File::find($model->id); // $files = \System\Models\File::find($model->file); // $new = $this->file()->withDeferred($this->sessionKey)->first()->getPath();; // $fileRecord = \October\Rain\Database\Models\DeferredBinding::where([ // 'master_type' => 'Tps\Shops\Models\Report', // <- REPLACE WITH YOUR MODEL(ModelName) // "master_field" => "file", // <- REPLACE WITH ATTACHEMNT MODEL (gallery) // "slave_type" => "System\Models\File", // "session_key" => post('_session_key') // ])->get()->first(); // $fileRecord = (new \System\Models\File)->fromData($model->file, 'logo.png'); // $fileRecord = $model->file->getPath();; // $fileRecord = $model->file->getLocalPath();; // if($fileRecord){ // echo ""; // dd($fileRecord); // $zip = new ZipArchive(); // $status = $zip->open($fileRecord); // if ($status !== true) { // throw new \Exception($status); // } // else{ // $storageDestinationPath= storage_path("app/uploads/unzip/"); // if (!\File::exists( $storageDestinationPath)) { // \File::makeDirectory($storageDestinationPath, 0755, true); // } // $zip->extractTo($storageDestinationPath); // $zip->close(); // // return back() // // ->with('success','You have successfully extracted zip.'); // } // }else{ // // dd("aaa"); // } } }