adrema/app/Course/Controllers/CourseController.php

37 lines
1.1 KiB
PHP
Raw Normal View History

2021-11-19 22:58:27 +01:00
<?php
namespace App\Course\Controllers;
2021-11-20 00:48:42 +01:00
use App\Course\Models\CourseMember;
2021-11-20 01:09:28 +01:00
use App\Course\Requests\DestroyRequest;
2021-11-19 22:58:27 +01:00
use App\Course\Requests\StoreRequest;
2021-11-20 00:48:42 +01:00
use App\Course\Requests\UpdateRequest;
2021-11-19 22:58:27 +01:00
use App\Http\Controllers\Controller;
use App\Member\Member;
2022-02-19 15:18:24 +01:00
use App\Setting\NamiSettings;
2021-11-19 22:58:27 +01:00
use Illuminate\Http\RedirectResponse;
class CourseController extends Controller
{
2022-02-19 15:18:24 +01:00
public function store(Member $member, StoreRequest $request, NamiSettings $settings): RedirectResponse
2021-11-19 22:58:27 +01:00
{
2022-02-19 15:18:24 +01:00
$request->persist($member, $settings);
2021-11-19 22:58:27 +01:00
2021-11-20 11:27:38 +01:00
return redirect()->back()->success('Ausbildung erstellt');
2021-11-19 22:58:27 +01:00
}
2021-11-20 00:48:42 +01:00
2022-02-19 18:06:07 +01:00
public function update(Member $member, CourseMember $course, UpdateRequest $request, NamiSettings $settings): RedirectResponse
2021-11-20 00:48:42 +01:00
{
2022-02-19 18:06:07 +01:00
$request->persist($member, $course, $settings);
2021-11-20 00:48:42 +01:00
2021-11-20 11:27:38 +01:00
return redirect()->back()->success('Ausbildung aktualisiert');
2021-11-20 00:48:42 +01:00
}
2021-11-20 01:09:28 +01:00
2022-02-19 18:06:07 +01:00
public function destroy(Member $member, CourseMember $course, DestroyRequest $request, NamiSettings $settings): RedirectResponse
2021-11-20 01:09:28 +01:00
{
2022-02-19 18:06:07 +01:00
$request->persist($member, $course, $settings);
2021-11-20 01:09:28 +01:00
2021-11-20 11:27:38 +01:00
return redirect()->back()->success('Ausbildung gelöscht');
2021-11-20 01:09:28 +01:00
}
2021-11-19 22:58:27 +01:00
}