diff --git a/src/Router.php b/src/Router.php index 7845da6..92fce43 100644 --- a/src/Router.php +++ b/src/Router.php @@ -325,6 +325,19 @@ public static function redirect( }); } + /** + * Add a route that renders a view + * + * @param string $pattern The route pattern/path to match + * @param string $view The view to render + */ + public static function view(string $pattern, string $view) + { + static::get($pattern, function () use ($view) { + return response()->view($view); + }); + } + /** * Create a resource route for using controllers. *