Changes
This commit is contained in:
@@ -18,9 +18,9 @@ class ClientLibraryNewsController extends Controller
|
||||
return Inertia::render('Client/Library-news/Index', compact('posts'));
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
public function show(string $slug)
|
||||
{
|
||||
$post = new ClientLibraryPostListResource(LibraryNews::query()->find($id));
|
||||
$post = new ClientLibraryPostListResource(LibraryNews::query()->where('slug', $slug)->firstOrFail());
|
||||
return Inertia::render('Client/Library-news/Show', compact('post'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,14 +113,15 @@ class ClientProgramController extends Controller
|
||||
|
||||
public function show(string $slug)
|
||||
{
|
||||
$program = new EducationalProgramFullResource(EducationalProgram::query()->where('slug', $slug)->with(['admission_plans', 'directionStudy'])->first());
|
||||
$program = new EducationalProgramFullResource(EducationalProgram::query()->where('slug', $slug)->with(['admission_plans', 'directionStudy'])->firstOrFail());
|
||||
$formsEducational = BudgetEducation::cases();
|
||||
$formsEducational = collect($formsEducational);
|
||||
$formsEdu = $formsEducational->mapWithKeys(function ($formEducational) {
|
||||
return [$formEducational->value => $formEducational->getLabel()];
|
||||
});
|
||||
|
||||
$seo = $this->seo;
|
||||
dd($program);
|
||||
$seo = $program->seo;
|
||||
return Inertia::render('Client/Programs/Show', compact('program', 'formsEdu', 'seo'));
|
||||
}
|
||||
|
||||
@@ -158,41 +159,5 @@ class ClientProgramController extends Controller
|
||||
});
|
||||
}]);
|
||||
}
|
||||
// public function bakalavriat()
|
||||
// {
|
||||
// $naprs = DirectionStudyResource::collection(
|
||||
// DirectionStudy::forBachelorLevel()
|
||||
// ->withActiveAdmissionCampaign()
|
||||
// ->withActivePrograms()
|
||||
// ->get()
|
||||
// );
|
||||
// $campaignName = $this->getAdmissionCampaignName();
|
||||
// return Inertia::render('Client/Programs/Index', compact('naprs', 'campaignName'));
|
||||
// }
|
||||
//
|
||||
// public function spo()
|
||||
// {
|
||||
// $naprs = DirectionStudyResource::collection(
|
||||
// DirectionStudy::forMiddleLevel()
|
||||
// ->withActiveAdmissionCampaign()
|
||||
// ->withActivePrograms()
|
||||
// ->get()
|
||||
// );
|
||||
// $campaignName = $this->getAdmissionCampaignName();
|
||||
// return Inertia::render('Client/Programs/Index', compact('naprs', 'campaignName'));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public function magistratura()
|
||||
// {
|
||||
// $naprs = DirectionStudyResource::collection(
|
||||
// DirectionStudy::forMasterLevel()
|
||||
// ->withActiveAdmissionCampaign()
|
||||
// ->withActivePrograms()
|
||||
// ->get()
|
||||
// );
|
||||
// $campaignName = $this->getAdmissionCampaignName();
|
||||
// return Inertia::render('Client/Programs/Index', compact('naprs', 'campaignName'));
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ class ClientVirtualExhibitionController extends Controller
|
||||
return Inertia::render('Client/Library-exhibitions/Index', compact('exhibitions'));
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
public function show(string $slug)
|
||||
{
|
||||
$exhibition = new ClientVirtualExhibitionListResource(VirtualExhibition::query()->find($id));
|
||||
$exhibition = new ClientVirtualExhibitionListResource(VirtualExhibition::query()->where('slug', $slug)->firstOrFail());
|
||||
return Inertia::render('Client/Library-exhibitions/Show', compact('exhibition'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,8 @@ class GenerateSitemapController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$sitemap = Sitemap::create();
|
||||
|
||||
$this->generatePages($sitemap);
|
||||
$this->generatePosts($sitemap);
|
||||
|
||||
$sitemap->writeToFile(public_path('sitemap.xml'));
|
||||
}
|
||||
|
||||
protected function generatePages(Sitemap $sitemap)
|
||||
|
||||
@@ -43,7 +43,7 @@ class MainController extends Controller
|
||||
|
||||
$path = route('index', null, false);
|
||||
$page = Page::where('path', $path)->first();
|
||||
$seo = $page->seo;
|
||||
$seo = $page->seo ?? null;
|
||||
|
||||
return Inertia::render('Main', compact('posts', 'events', 'sliders', 'educations', 'seo'));
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ class PersonController extends Controller
|
||||
return Inertia::render('Client/Persons/Index', compact('persons', 'filters'));
|
||||
}
|
||||
|
||||
public function show(string $id)
|
||||
public function show(string $slug)
|
||||
{
|
||||
$person = new ClientFullInfoPersonResource(User::query()->with(['userDetail', 'departments_work.faculty', 'departments_teach.faculty', 'divisions', 'faculties'])->where('id', $id)->firstOrFail());
|
||||
$person = new ClientFullInfoPersonResource(User::query()->with(['userDetail', 'departments_work.faculty', 'departments_teach.faculty', 'divisions', 'faculties'])->where('slug', $slug)->firstOrFail());
|
||||
return Inertia::render('Client/Persons/Show', compact('person'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user