Skip to content

Conversation

artengin
Copy link
Contributor

@artengin artengin commented Oct 5, 2025

Refs: #39

@coveralls
Copy link

coveralls commented Oct 5, 2025

Pull Request Test Coverage Report for Build 18301550428

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 97.909%

Totals Coverage Status
Change from base Build 18188249342: 0.01%
Covered Lines: 281
Relevant Lines: 287

💛 - Coveralls

@artengin
Copy link
Contributor Author

artengin commented Oct 5, 2025

Could not reproduce the issue in laravel-empty-project

The problem was that on a fresh Laravel project, the laravel/ui package was not installed, and the method

$this->publishWebLogin();

which adds Auth::routes() , caused an error, after which artisan stopped working.

image

Copy link
Collaborator

@DenTray DenTray left a comment

Choose a reason for hiding this comment

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

@artengin as discussed, it seems that the main issue on the fresh laravel installations is the monologue package issue, let's try to fix it at first

> Illuminate\Foundation\ComposerScripts::prePackageUninstall
PHP Fatal error:  Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = []) in /app/vendor/monolog/monolog/src/Monolog/Logger.php on line 683
PHP Fatal error:  Uncaught Error: Class "Monolog\Logger" not found in /app/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:60
Stack trace:
#0 /app/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php(38): Monolog\Handler\AbstractHandler->setLevel(Monolog\Level::Debug)
#1 /app/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(52): Monolog\Handler\AbstractHandler->__construct(Monolog\Level::Debug, true)
#2 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(197): Monolog\Handler\StreamHandler->__construct('/app/storage/lo...', Monolog\Level::Debug)
#3 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(151): Illuminate\Log\LogManager->createEmergencyLogger()
#4 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(125): Illuminate\Log\LogManager->get('stack')
#5 /app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(703): Illuminate\Log\LogManager->driver()
#6 /app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(403): Illuminate\Log\LogManager->error('Class "Monolog\\...', Array)
#7 /app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(366): Illuminate\Foundation\Exceptions\Handler->reportThrowable(Object(Error))
#8 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(186): Illuminate\Foundation\Exceptions\Handler->report(Object(Error))
#9 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(258): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))
#10 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->{closure:Illuminate\Foundation\Bootstrap\HandleExceptions::forwardsTo():257}(Object(Error))
#11 {main}
  thrown in /app/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php on line 60

@DenTray DenTray assigned artengin and unassigned DenTray Oct 6, 2025
@artengin
Copy link
Contributor Author

artengin commented Oct 6, 2025

This error occurs when we choose to remove the initializer package after completion.

The error can also be reproduced by simply installing a fresh Laravel instance and running these commands:

composer create-project --prefer-dist laravel/laravel laravel-test
cd laravel-test
composer require ronasit/laravel-project-initializator --dev
composer remove ronasit/laravel-project-initializator --dev

To fix the error, I added --no-scripts to the removal command.

@artengin artengin assigned DenTray and unassigned artengin Oct 6, 2025
@DenTray DenTray requested a review from Copilot October 7, 2025 03:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds installation of the laravel/ui package to the Laravel project initialization process and refactors the timing of when certain operations are performed.

  • Adds composer require laravel/ui as the first command in the shell commands array
  • Moves the web login publishing step to execute after all composer requirements are installed
  • Changes the package uninstallation to use --no-script flag and execute it separately at the end

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Commands/InitCommand.php Adds laravel/ui installation, refactors web login publishing timing, and improves package uninstallation handling
tests/InitCommandTest.php Updates test expectations to reflect the new command order and package installation changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DenTray DenTray merged commit 20e47a3 into main Oct 7, 2025
3 checks passed
@DenTray DenTray deleted the add-install-laravel-ui branch October 7, 2025 03:59
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.

3 participants