Skip to content

Commit

Permalink
Customizes a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Aug 4, 2023
1 parent 36b1188 commit 8a09e49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/FolioManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function route(string $path = null, ?string $uri = '/', array $middleware
public function registerRoute(string $path, string $uri, array $middleware, ?string $domain): void
{
$path = realpath($path);
$uri = '/'.ltrim($uri, '/');

if (! is_dir($path)) {
throw new InvalidArgumentException("The given path [{$path}] is not a directory.");
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@
});

test('declaring "domain.com" last', function () {
Folio::domain('another-domain.com')->path(__DIR__.'/resources/views/pages');
Folio::domain('domain.com')->path(__DIR__.'/resources/views/pages');
Folio::domain('another-domain.com')->uri('/app')->path(__DIR__.'/resources/views/pages');
Folio::domain('domain.com')->uri('/app')->path(__DIR__.'/resources/views/pages');

$response = $this->get('https://domain.com/dashboard');
$response = $this->get('https://domain.com/app/dashboard');

$response->assertStatus(200);
});
Expand Down

0 comments on commit 8a09e49

Please sign in to comment.