Skip to content

[12.x] Fixed a bug in using illuminate/console in external apps #55430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 16, 2025

Conversation

andrey-helldar
Copy link
Contributor

Problem

When using the illuminate/console package in an external application outside the Laravel Framework, a problem started to appear as the package started to access the Illuminate\Database\Migrations\MigrationResult class even though the illuminate/database dependency is not set.

This behavior was added in version 12.4.0 (#55011).

Error

PHP Fatal error:  Uncaught Error: Class "Illuminate\Database\Migrations\MigrationResult" not found in /home/runner/work/lang/lang/vendor/illuminate/console/View/Components/Task.php:38
Stack trace:
#0 /home/runner/work/lang/lang/vendor/illuminate/console/View/Components/Factory.php(59): Illuminate\Console\View\Components\Task->render()
#1 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/src/Helpers/Output.php(42): Illuminate\Console\View\Components\Factory->__call()
#2 /home/runner/work/lang/lang/vendor/dragon-code/support/src/Instances/Call.php(133): LaravelLang\StatusGenerator\Helpers\Output->{closure:LaravelLang\StatusGenerator\Helpers\Output::task():42}()
#3 /home/runner/work/lang/lang/vendor/dragon-code/support/src/Facades/Facade.php(30): DragonCode\Support\Instances\Call->callback()
#4 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/src/Helpers/Output.php(55): DragonCode\Support\Facades\Facade::__callStatic()
#5 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/src/Helpers/Output.php(40): LaravelLang\StatusGenerator\Helpers\Output->when()
#6 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/src/Commands/Command.php(73): LaravelLang\StatusGenerator\Helpers\Output->task()
#7 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/src/Commands/Command.php(49): LaravelLang\StatusGenerator\Commands\Command->handleByProcessor()
#8 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/src/Commands/Command.php(36): LaravelLang\StatusGenerator\Commands\Command->handle()
#9 /home/runner/work/lang/lang/vendor/symfony/console/Command/Command.php(279): LaravelLang\StatusGenerator\Commands\Command->execute()
#10 /home/runner/work/lang/lang/vendor/symfony/console/Application.php(1076): Symfony\Component\Console\Command\Command->run()
#11 /home/runner/work/lang/lang/vendor/symfony/console/Application.php(342): Symfony\Component\Console\Application->doRunCommand()
#12 /home/runner/work/lang/lang/vendor/symfony/console/Application.php([19](https://github.com/Laravel-Lang/lang/actions/runs/14458858865/job/40547605464#step:5:20)3): Symfony\Component\Console\Application->doRun()
#13 /home/runner/work/lang/lang/vendor/laravel-lang/status-generator/bin/lang(50): Symfony\Component\Console\Application->run()
#14 /home/runner/work/lang/lang/vendor/bin/lang(119): include('...')
#15 {main}
  thrown in /home/runner/work/lang/lang/vendor/illuminate/console/View/Components/Task.php on line 38

Solution

Replace the status reference from Illuminate Database with your own.

@andrey-helldar andrey-helldar changed the title Fixed a bug in using illuminate/console in external apps [12.x] Fixed a bug in using illuminate/console in external apps Apr 16, 2025
@andrey-helldar andrey-helldar force-pushed the patch/2025-04-16/12-45 branch from 3bb7022 to f243113 Compare April 16, 2025 10:07
@andrey-helldar andrey-helldar force-pushed the patch/2025-04-16/12-45 branch from f243113 to 5020a41 Compare April 16, 2025 10:15
@andrey-helldar
Copy link
Contributor Author

Oops, sorry. I have all classes created with strict typing rule by default. I forgot to remove it 😅

@taylorotwell taylorotwell merged commit fcd31a6 into laravel:12.x Apr 16, 2025
58 of 59 checks passed
@andrey-helldar andrey-helldar deleted the patch/2025-04-16/12-45 branch April 16, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants