composer require edqe/laravel-uploadthing
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();