You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
750 B
32 lines
750 B
<?php
|
|
|
|
namespace App\Http\Controllers\V1;
|
|
|
|
use App\Enums\FileFormatEnum;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Jobs\ChunkFile;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\Str;
|
|
|
|
class ConvertController extends Controller
|
|
{
|
|
public function convert(FileFormatEnum $format, Request $request)
|
|
{
|
|
Storage::put(
|
|
$request->file('file')->getClientOriginalName(),
|
|
$request->file('file')->getContent(),
|
|
);
|
|
|
|
ChunkFile::dispatch(
|
|
Str::uuid(),
|
|
$request->file('file')->getClientOriginalName(),
|
|
$format
|
|
);
|
|
|
|
return response([
|
|
'msg' => 'done',
|
|
'success' => true
|
|
]);
|
|
}
|
|
}
|
|
|