<?php

namespace App\Http\Controllers;

use App\Models\MaaUser;
use App\Http\Requests\StoreMaaUserRequest;
use App\Http\Requests\UpdateMaaUserRequest;
use Illuminate\Http\Request;

class MaaUserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
        $users = MaaUser::all();
        return $users;
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \App\Http\Requests\StoreMaaUserRequest  $request
     * @return \Illuminate\Http\Response
     */
    public function store(StoreMaaUserRequest $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Models\MaaUser  $maaUser
     * @return \Illuminate\Http\Response
     */
    public function show(Request $request,MaaUser $maaUser)
    {
        //
        $maaUser = MaaUser::where('job_id', '=', $request->id)->get()[0];
        $response = [
            'user' => $maaUser,
        ];

        return response($response, 201);
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Models\MaaUser  $maaUser
     * @return \Illuminate\Http\Response
     */
    public function edit(MaaUser $maaUser)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \App\Http\Requests\UpdateMaaUserRequest  $request
     * @param  \App\Models\MaaUser  $maaUser
     * @return \Illuminate\Http\Response
     */
    public function update(UpdateMaaUserRequest $request, MaaUser $maaUser)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\MaaUser  $maaUser
     * @return \Illuminate\Http\Response
     */
    public function destroy(MaaUser $maaUser)
    {
        //
    }
}
