-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds new API for
middleware
and withTrashed
- Loading branch information
1 parent
5b9e4e4
commit 8e11dc1
Showing
9 changed files
with
94 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Laravel\Folio\Options; | ||
|
||
use Closure; | ||
use function Laravel\Folio\{middleware, withTrashed}; | ||
|
||
class PageOptions | ||
{ | ||
/** | ||
* Adds one or more middleware to the current page. | ||
*/ | ||
public function middleware(Closure|string|array $middleware = []): static | ||
{ | ||
return middleware($middleware); | ||
} | ||
|
||
/** | ||
* Indicates that the current page should include trashed models. | ||
*/ | ||
public function withTrashed(bool $withTrashed = true): static | ||
{ | ||
return withTrashed($withTrashed); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
tests/Feature/resources/views/pages/books/[...Tests.Feature.Fixtures.Book]/detail.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...eature/resources/views/pages/deleted-podcasts/[.Tests.Feature.Fixtures.Podcast].blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
<?php | ||
use function Laravel\Folio\{page}; | ||
page(withTrashed: true); | ||
use function Laravel\Folio\{withTrashed}; | ||
withTrashed(); | ||
?> | ||
|
||
<div> | ||
{{ $podcast->name }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters