<?php

namespace App\Http\Controllers;

use App\Models\Datepicker;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;

class DatepickerController extends Controller
{
    public function create()
    {
        return view('datepicker');
    }

    public function datepicker(Request $request)
    {
        $datepicker = new Datepicker();
        $datepicker->data = $request->get('data');
        $datepicker->cpf = $request->get('cpf');
        $datepicker->detentor = $request->get('detentor');
        $datepicker->agendado = $request->get('agendado');
        $datepicker->save();
        return redirect()->back();
        //return Redirect::route('dadosAtendimento', ['cpf'=>$id,])->with('message', 'State saved correctly!!!');
        // return view('dadosAtendimento');
    }
}
