����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 18.218.195.15 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/cbt.gltechlimited.com/app/Http/Controllers/User/ |
Upload File : |
<?php namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use App\Models\Section; use App\Models\SubCategory; use App\Settings\LocalizationSettings; use App\Transformers\Platform\SubCategoryCardTransformer; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Facades\Cookie; use Inertia\Inertia; class PracticeDashboardController extends Controller { private LocalizationSettings $localizationSettings; public function __construct(LocalizationSettings $localizationSettings) { $this->middleware(['role:guest|student|employee', 'verify.syllabus']); $this->localizationSettings = $localizationSettings; } /** * User's Learn & Practice Screen * * @return \Inertia\Response */ public function learn() { $category = auth()->user()->selectedSyllabus(); return Inertia::render('User/LearnPractice', [ 'category' => fractal(SubCategory::with(['sections:id,name,code,slug', 'subCategoryType:id,name', 'category:id,name']) ->orderBy('name')->find($category->id), new SubCategoryCardTransformer()) ->toArray()['data'] ]); } /** * Section's Learn & Practice Screen * * @param SubCategory $category * @param $section * @return \Inertia\Response */ public function learnSection(SubCategory $category, $section) { $catId = $category->id; $section = Section::with(['skills' => function($query) use ($catId) { $query->withCount(['practiceSets' => function (Builder $builder) use ($catId) { $builder->where('is_active', '=', 1)->where('sub_category_id', '=', $catId); }, 'practiceLessons' => function (Builder $builder) use ($catId) { $builder->where('sub_category_id', '=', $catId); }, 'practiceVideos' => function (Builder $builder) use ($catId) { $builder->where('sub_category_id', '=', $catId); }]); }])->where('slug', $section) ->firstOrFail(); return Inertia::render('User/LearnPracticeSection', [ 'category' => $category, 'section' => $section ]); } }