<?php

namespace App\Http\Controllers\Modal;

use Illuminate\Http\Request;

class ModalCancelController extends Controller
{
    public function index(Request $request)
    {
        $path = $request->input('path', '/');
        $title = $request->input('title', 'Your Title');
        $message = $request->input('message', 'Your Message');
        $dirty = $request->input('dirty', true);
        $name = $request->input('name', 'Cancel');

        return view('modal.cancel', compact('path', 'title', 'message', 'dirty', 'name'));
    }

    public function confirm(Request $request)
    {
        return redirect($request->input('path', '/'));
    }
}