<?php

namespace App\Http\Controllers;

use App\Job;
use Illuminate\Http\Request;

class JobController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

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

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {   
        $gender = null;
        if($request->get('gender')) {
            $gender = implode(', ', $request->get('gender'));
        }
        return response()->json(['gender' => $gender]);
        // $job = new Job();
        // $job->job_title = $request->get('job_title');
        // $job->job_type = $request->get('job_type');
        // $job->department = $request->get('department');
        // $job->salary = $request->get('salary');
        // $job->branch = $request->get('branch');
        // $job->day = $request->get('day');
        // $job->time = $request->get('time');
        // $job->gender = $request->get('gender');
        // $job->num = $request->get('num');
        // $job->degree = $request->get('degree');
        // $job->gpax = $request->get('gpax');
        // $job->phase = $request->get('phase');
        // $job->feature = $request->get('feature');
        // $job->role = $request->get('role');
        // $job->welfare = $request->get('welfare');
        // $job->company_id = $request->get('id');
        // $job->save();
        return response()->json(['job' => $request->all()]);
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

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

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

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