20 lines
465 B
PHP
20 lines
465 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Chapter;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Jobs\DownloadVideoFile;
|
|
use App\Models\Chapter;
|
|
use App\Models\Course;
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
class Sync extends Controller
|
|
{
|
|
public function __invoke(Course $course, Chapter $chapter): RedirectResponse
|
|
{
|
|
$chapter->update(['sync_offline' => 1]);
|
|
DownloadVideoFile::dispatch($chapter->id);
|
|
return redirect()->back();
|
|
}
|
|
}
|