In standalone mode, you can use the upload method to upload a file. This method takes in the the original file and the cover which is optional. Once the upload is complete, Larupload will automatically generate a unique filename and save the file to the specified path.
<?php
namespace App\Http\Controllers;
use Mostafaznv\Larupload\Larupload;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UploadController extends Controller
{
public function store(Request $request): JsonResponse
{
$file = $request->file('file');
$cover = $request->file('cover');
$upload = Larupload::init('your/base/path')->upload($file, $cover);
return response()->json($upload);
}
}