Moved video files to public/videos directory, small refactoring.
This commit is contained in:
@@ -5,14 +5,19 @@ namespace App\Http\Controllers;
|
||||
use App\Http\SymfonyCastDl\HtmlParser;
|
||||
use App\Http\SymfonyCastDl\SymfonyCastDlService;
|
||||
use App\Models\Course;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
public function index(string $track = null)
|
||||
{
|
||||
$courses = Course::where('tracks', 'like', '%'.$track.'%')->with('chapters')->withCount('chapters')->get();
|
||||
|
||||
$courses = Course::where('tracks', 'like', '%' . $track . '%')->with('chapters')->withCount([
|
||||
'chapters',
|
||||
'chapters as chapters_to_sync' => function (Builder $query) {
|
||||
$query->where('sync_offline', 1);
|
||||
},
|
||||
])->get();
|
||||
return view('index', compact(['courses']));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user