Files
animethemes-server/app/Http/Controllers/Wiki/Video/Script/ScriptController.php
T
paranarimasu 8b6b196c99 feat(admin): migrate db dumps from github to platform (#465)
* feat: migrate encoding scripts from github to platform

* style: fix StyleCI finding

* fix: don't concatenate updated videos when attempting to attach entry on video upload

* fix(api): fix field dependencies & feat(admin): upload script from video detail screen
2022-09-24 00:01:37 -05:00

34 lines
820 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Controllers\Wiki\Video\Script;
use App\Constants\Config\VideoConstants;
use App\Http\Controllers\Controller;
use App\Models\Wiki\Video\VideoScript;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* Class ScriptController.
*/
class ScriptController extends Controller
{
/**
* Download dump.
*
* @param VideoScript $script
* @return StreamedResponse
*/
public function show(VideoScript $script): StreamedResponse
{
/** @var FilesystemAdapter $fs */
$fs = Storage::disk(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
return $fs->download($script->path);
}
}