guessExtension() ?? $file->getClientOriginalExtension(); $storedFilename = Str::uuid().'.'.$extension; $path = date('Y/m/d').'/'.$storedFilename; $this->storage->put('images', $path, file_get_contents($file->getRealPath())); $record = $this->repository->create([ 'original_name' => $file->getClientOriginalName(), 'file_path' => "images/{$path}", 'storage_disk' => $this->storage->getDisk(), 'file_size' => $file->getSize(), 'mime_type' => $file->getMimeType(), 'uploaded_by' => $uploadedBy, ]); \App\Extension\HookManager::doAction('sirsoft-ckeditor5.image.after_upload', $record); return $record; } }