<?php

namespace App\Http\Controllers;

use App\Models\Pasien;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class PasienController extends Controller
{
    // FORM INPUT
    public function create()
    {
        return view('user.pasien.create');
    }

    // SIMPAN DATA
    public function store(Request $request)
    {
        Pasien::create([
            'nama' => $request->nama,
            'jenis_kelamin' => $request->jenis_kelamin,
            'tempat_lahir' => $request->tempat_lahir,
            'tanggal_lahir' => $request->tanggal_lahir,
            'alamat' => $request->alamat,
            'no_telp' => $request->no_telp,
            'user_id' => Auth::id(),
        ]);

        return redirect()->route('user.diagnosa');
    }
}