%PDF- %PDF-
Direktori : /data/www_bck/loslex_bck/demo/app/Http/Controllers/ |
Current File : //data/www_bck/loslex_bck/demo/app/Http/Controllers/OrganizerGroupUserController.php |
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\OrganizerGroupUser; use Illuminate\Http\RedirectResponse; class OrganizerGroupUserController extends Controller { /** * Store a newly created resource in storage. */ public function store(Request $request) : RedirectResponse { // $request->validateWithBag('addOrgMember', [ 'user_id' => 'required|numeric|exists:users,id', 'organizer_group_id' => 'required|numeric|exists:organizer_groups,id', ]); $newmember = OrganizerGroupUser::create([ 'user_id' => $request->user_id, 'organizer_group_id' => $request->organizer_group_id, ]); return redirect(route('organizer.show', $newmember->organizer_group_id)); } /** * Remove the specified resource from storage. */ public function destroy(OrganizerGroupUser $orgmember) : RedirectResponse { $orgmember->delete(); return redirect(route('organizer.show', $orgmember->organizer_group_id)); } }