Skip to content

Commit

Permalink
Merge pull request #1 from inmanturbo/main
Browse files Browse the repository at this point in the history
handler method override no longer needed to bring in router
  • Loading branch information
inmanturbo authored Feb 7, 2024
2 parents 3edfa4a + a0915b4 commit fd7fe88
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 fd7fe88

Please sign in to comment.