adrema/app/Course/Controllers/CourseController.php

29 lines
727 B
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-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);
return redirect()->route('member.index');
}
2021-11-20 00:48:42 +01:00
public function update(Member $member, CourseMember $course, UpdateRequest $request): RedirectResponse
{
$request->persist($member, $course);
return redirect()->route('member.index');
}
2021-11-19 22:58:27 +01:00
}