-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Providers): Adjust convention for boot pipes - use Boot prefix
BREAKING CHANGE: Low conflict - Renamed LoadProviderRoutes Pipe to BootProviderRoutesPipe, LoadProviderViewComponents Pipe to BootProviderViewComponents and RegisterProviderPoliciesPipe to BootProviderPoliciesPipe
- Loading branch information
Showing
6 changed files
with
42 additions
and
9 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 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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LaraStrict\Providers\Pipes; | ||
|
||
use Closure; | ||
use Illuminate\Contracts\View\Factory; | ||
use LaraStrict\Contracts\AppServiceProviderPipeContract; | ||
use LaraStrict\Contracts\HasViewComposers; | ||
use LaraStrict\Providers\Entities\AppServiceProviderEntity; | ||
|
||
class BootViewComposersPipe implements AppServiceProviderPipeContract | ||
{ | ||
public function __construct( | ||
private readonly Factory $viewFactory, | ||
) { | ||
} | ||
|
||
public function handle(AppServiceProviderEntity $appServiceProvider, Closure $next): void | ||
{ | ||
// We need to load view components to its own namespace because Views/components | ||
// requires lowercase components string (not compatible). | ||
if ($appServiceProvider->serviceProvider instanceof HasViewComposers) { | ||
$appServiceProvider->serviceProvider->bootViewComposers( | ||
serviceName: $appServiceProvider->serviceName, | ||
viewFactory: $this->viewFactory, | ||
); | ||
} | ||
|
||
$next($appServiceProvider); | ||
} | ||
} |
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