Skip to content

Commit

Permalink
[10.x] Adding Pipeline Facade (#46271)
Browse files Browse the repository at this point in the history
* feat: added in pipeline facade, added singleton binding

* Changed singleton to simple bind

* chore: disabled caching of instance on pipeline facade, added in docblocks

* formatting

* Update facade docblocks

---------

Co-authored-by: jaetooledev <jaetooledev@gmail.com>
Co-authored-by: Taylor Otwell <taylor@laravel.com>
Co-authored-by: taylorotwell <taylorotwell@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 3, 2023
1 parent 552f353 commit 4ae98ef
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Pipeline/PipelineServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ class PipelineServiceProvider extends ServiceProvider implements DeferrableProvi
public function register()
{
$this->app->singleton(
PipelineHubContract::class, Hub::class
PipelineHubContract::class,
Hub::class
);

$this->app->bind('pipeline', fn ($app) => new Pipeline($app));
}

/**
Expand All @@ -29,6 +32,7 @@ public function provides()
{
return [
PipelineHubContract::class,
'pipeline',
];
}
}
23 changes: 23 additions & 0 deletions src/Illuminate/Support/Facades/Pipeline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Illuminate\Support\Facades;

class Pipeline extends Facade
{
/**
* Indicates if the resolved instance should be cached.
*
* @var bool
*/
protected static $cached = false;

/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'pipeline';
}
}

0 comments on commit 4ae98ef

Please sign in to comment.