<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, ValidatesRequests;

    protected function safeView(string $view, array $data = [])
    {
        if (!view()->exists($view)) {
            abort(404, 'Page not found');
        }

        return view($view, $data);
    }
}
