Skip to content

Commit

Permalink
Uses container instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Jul 10, 2023
1 parent 8c4459a commit 6c5217a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Laravel\Folio;

use Closure;
use Illuminate\Container\Container;
use Illuminate\Support\Arr;
use Laravel\Folio\Options\PageOptions;

Expand All @@ -11,7 +12,7 @@
*/
function middleware(Closure|string|array $middleware = []): PageOptions
{
app(InlineMetadataInterceptor::class)->whenListening(
Container::getInstance()->make(InlineMetadataInterceptor::class)->whenListening(
fn () => Metadata::instance()->middleware = Metadata::instance()->middleware->merge(Arr::wrap($middleware)),
);

Expand All @@ -23,7 +24,7 @@ function middleware(Closure|string|array $middleware = []): PageOptions
*/
function withTrashed(bool $withTrashed = true): PageOptions
{
app(InlineMetadataInterceptor::class)->whenListening(
Container::getInstance()->make(InlineMetadataInterceptor::class)->whenListening(
fn () => Metadata::instance()->withTrashed = $withTrashed,
);

Expand Down

0 comments on commit 6c5217a

Please sign in to comment.