Skip to content

Commit

Permalink
handler method override no longer needed to bring in router
Browse files Browse the repository at this point in the history
  • Loading branch information
inmanturbo committed Feb 7, 2024
1 parent 3edfa4a commit a0915b4
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/TurboHX.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
};
}
}

0 comments on commit a0915b4

Please sign in to comment.