Dedicated asset and file upload delivery server for Laravel applications
/api/upload
— Upload a single file (multipart/form-data)
/api/upload-multiple
— Batch upload multiple files (files[])
/api/delete
— Delete file by URL or relative path
/api/info?path=...
— Get file size, mime type and modified date
/api/health
— Health check & uptime status
1. Add to your Laravel .env:
CDN_BASE_URL=https://cdn.schoolaxis.tech
CDN_API_KEY=cdn_7e52088d4005160fd6c88a2d0029de956c3882bb48a02426
ASSET_URL=https://cdn.schoolaxis.tech/assets
2. Uploading in any Laravel Controller:
use App\Services\CdnClient;
public function store(Request $request)
{
$request->validate(['avatar' => 'required|image|max:10240']);
// Uploads file directly to CDN in 'avatars' folder
$result = CdnClient::upload($request->file('avatar'), 'avatars');
// Save CDN URL to database:
$student->avatar_url = $result['url'];
$student->save();
return response()->json(['url' => $result['url']]);
}
3. Deleting from CDN:
CdnClient::delete($student->avatar_url);