Skip to content

Edqe14/laravel-uploadthing

Repository files navigation

UploadThing Laravel

Simple PHP port of UploadThing's UTApi library

GitHub License Packagist Downloads GitHub issues

📥 Installation

composer require edqe/laravel-uploadthing

📝 Usage

use UploadThing\UploadThing;

$uploadThing = new UploadThing('your-api-key');

// Upload a file
$file = $request->file('file');
$uploadThing->upload($file);

// Get file list
$uploadThing->listFiles();

// Rename files
$uploadThing->renameFiles([
  ["fileKey" => "fileKey1", "newName" => "newName2"],
  ["fileKey" => "fileKey2", "newName" => "newName2"]
]);
// or
$uploadThing->renameFile(["fileKey" => "fileKey1", "newName" => "newName2"]);

// Delete files
$uploadThing->deleteFiles(["fileKey1", "fileKey2"]);

// Get file urls
$uploadThing->getFileUrls(["fileKey1", "fileKey2"]);

// Get usage stats
$uploadThing->getUsageInfo();

📄 License

MIT