<?php

namespace App\Http\Controllers\Applience;

use App\Http\Controllers\Controller;
use App\Models\Applience;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

class ApplienceController extends Controller 
{
    public function showForm() : View 
    {
        return view('applience.form');
    }

    public function applyForm(Request $request) : RedirectResponse 
    {

        $applience = new Applience();
        $applience->firstname   = $request->firstname;
        $applience->lastname    = $request->lastname;
        $applience->email       = $request->email;
        $applience->status      = Applience::STATUS_PENDDING;
        $applience->save();

        return redirect()->back();
    }
}