<?php

namespace App\Http\Controllers;

use App\Models\Datepicker;
use Illuminate\Http\Request;

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

    public function datepicker(Request $request)
    {
        $datepicker = new Datepicker();
        $datepicker->id = $request->get('id');
        $datepicker->nome = $request->get('nome');
        $datepicker->cpf = $request->get('cpf');
        $datepicker->data = $request->get('data');
        $datepicker->save();
        return redirect('datepicker')->with('success', 'Agendamento adicionado com sucesso!');
    }
}
