Skip to content

Commit 6962e37

Browse files
committed
Automatically store the redirect upon calling make
1 parent 2cfd0f5 commit 6962e37

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

packages/framework/src/Support/Models/Redirect.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(string $path, string $destination)
2929

3030
public static function make(string $path, string $destination): static
3131
{
32-
return new static($path, $destination);
32+
return (new static($path, $destination))->store();
3333
}
3434

3535
public function render(): string

packages/framework/tests/Feature/RedirectTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ public function test_can_create_a_redirect()
2626
str_replace("\r", '', $redirect->render())
2727
);
2828

29-
$redirect->store();
30-
3129
$this->assertFileExists(Hyde::path('_site/foo.html'));
3230
$this->assertSame($redirect->render(), file_get_contents(Hyde::path('_site/foo.html')));
3331

0 commit comments

Comments
 (0)