Moved video files to public/videos directory, small refactoring.

This commit is contained in:
Krzysztof Płaczek
2023-03-30 12:46:30 +02:00
parent 5902bf7c2b
commit 5784cf8ed3
10 changed files with 42 additions and 41 deletions

View File

@@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers\Course;
use App\Http\Controllers\Controller;
use App\Jobs\DownloadVideoFile;
use App\Models\Course;
use Illuminate\Http\RedirectResponse;
class Sync extends Controller
{
public function __invoke(Course $course): RedirectResponse
{
$course->chapters->each->update(['sync_offline' => 1]);
$course->chapters->each(fn($chapter) => DownloadVideoFile::dispatch($chapter->id));
return redirect()->back();
}
}