Skip to content

Commit

Permalink
Fixed register service provider for L11
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick authored Apr 1, 2024
1 parent 6bedbf6 commit 43086d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ protected function registerServiceProvider(): void
{
$namespace = Str::replaceLast('\\', '', $this->getLaravel()->getNamespace());

if (file_exists($this->getLaravel()->bootstrapPath('providers.php'))) {
// @phpstan-ignore-next-line
return ServiceProvider::addProviderToBootstrapFile("{$namespace}\\Providers\\MetaTagsServiceProvider");
}

/** @psalm-suppress UndefinedFunction */
$config = file_get_contents(config_path('app.php'));
$line = $namespace . '\Providers\MetaTagsServiceProvider::class';
Expand Down

2 comments on commit 43086d3

@bernig
Copy link

@bernig bernig commented on 43086d3 Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This throws an fatal error when updating the package:
PHP Fatal error: A void function must not return a value in /var/www/simpsons/vendor/butschster/meta-tags/src/Console/InstallCommand.php on line 38

Context: Laravel 10, PHP 8.2

@uintaam
Copy link
Contributor

@uintaam uintaam commented on 43086d3 Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a PR to fix #66

Please sign in to comment.