diff --git a/src/TurboHX.php b/src/TurboHX.php index 9a2f129..66bbd07 100644 --- a/src/TurboHX.php +++ b/src/TurboHX.php @@ -2,13 +2,9 @@ namespace Inmanturbo\TurboHX; -use Closure; -use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use InvalidArgumentException; use Laravel\Folio\MountPath; -use Laravel\Folio\Pipeline\MatchedView; -use Laravel\Folio\RequestHandler; class TurboHX extends \Laravel\Folio\FolioManager { @@ -37,24 +33,4 @@ public function registerRoute(string $path, string $uri, array $middleware, ?str Route::any($prefix.'{any}', $this->handler())->where('any', '.*')->name('laravel-folio'); } - - /** - * Get the Folio request handler function. - */ - protected function handler(): Closure - { - return function (Request $request) { - $this->terminateUsing = null; - - $mountPaths = collect($this->mountPaths)->filter( - fn (MountPath $mountPath) => str_starts_with(mb_strtolower('/'.$request->path()), $mountPath->baseUri) - )->all(); - - return (new RequestHandler( - $mountPaths, - $this->renderUsing, - fn (MatchedView $matchedView) => $this->lastMatchedView = $matchedView, - ))($request); - }; - } }