adrema/app/Course/Controllers/CourseController.php

37 lines
1.0 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;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class CourseController extends Controller
{
public function store(Member $member, StoreRequest $request): RedirectResponse
{
$request->persist($member);
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
public function update(Member $member, CourseMember $course, UpdateRequest $request): RedirectResponse
{
$request->persist($member, $course);
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
public function destroy(Member $member, CourseMember $course, DestroyRequest $request): RedirectResponse
{
$request->persist($member, $course);
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
}