%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /mnt/tnb2/git/loslex/app/Http/Controllers/
Upload File :
Create Path :
Current File : //mnt/tnb2/git/loslex/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));
    }
}

Zerion Mini Shell 1.0