<?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->cpf = $request->get('cpf');
        $datepicker->data = $request->get('data');
        $datepicker->hora = $request->get('hora');
        $datepicker->detentor = $request->get('detentor');
        $datepicker->save();

         return view('dadosAtendimento')->with([
             'cpf' => $request->get('cpf'), 
             'detentor' => $request->get('detentor'),
             'data' => $request->get('data'),
             'id' => $request->get('id'),
             'hora' => $request->get('hora'),
             ]);
    }
}
