Hello, thanks for the great package.
After publishing the package with command
php artisan vendor:publish --provider="Haruncpi\LaravelLogReader\ServiceProvider" --tag="config"
and running
composer dump-autoload
The following error generated:
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In UrlGenerator.php line 120:
Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in <Laravel-rout-path>\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 68
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
The full error log is the following:
[2020-02-06 20:52:25] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php:192)
[stacktrace]
#0 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php(118): Illuminate\\Log\\LogManager->resolve(NULL)
#1 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php(98): Illuminate\\Log\\LogManager->get(NULL)
#2 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogManager.php(547): Illuminate\\Log\\LogManager->driver()
#3 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Exceptions\\Handler.php(121): Illuminate\\Log\\LogManager->error('Argument 2 pass...', Array)
#4 [--Laravel-rout-path--]\\app\\Exceptions\\Handler.php(37): Illuminate\\Foundation\\Exceptions\\Handler->report(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))
#5 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(376): App\\Exceptions\\Handler->report(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))
#6 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(141): Illuminate\\Foundation\\Console\\Kernel->reportException(Object(Symfony\\Component\\Debug\\Exception\\FatalThrowableError))
#7 [--Laravel-rout-path--]\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#8 {main}
"}
[2020-02-06 20:52:25] laravel.ERROR: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in [--Laravel-rout-path--]\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 68 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 2 passed to Illuminate\\Routing\\UrlGenerator::__construct() must be an instance of Illuminate\\Http\\Request, null given, called in [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\RoutingServiceProvider.php on line 68 at [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\UrlGenerator.php:120)
[stacktrace]
#0 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\RoutingServiceProvider.php(68): Illuminate\\Routing\\UrlGenerator->__construct(Object(Illuminate\\Routing\\RouteCollection), NULL, NULL)
#1 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(799): Illuminate\\Routing\\RoutingServiceProvider->Illuminate\\Routing\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
#2 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(681): Illuminate\\Container\\Container->build(Object(Closure))
#3 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(629): Illuminate\\Container\\Container->resolve('url', Array)
#4 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(776): Illuminate\\Container\\Container->make('url', Array)
#5 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\helpers.php(121): Illuminate\\Foundation\\Application->make('url', Array)
#6 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\helpers.php(932): app('Illuminate\\\\Cont...')
#7 [--Laravel-rout-path--]\\config\\laravel-log-reader.php(6): url('shopadmin')
#8 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\LoadConfiguration.php(72): require('C:\\\\xampp\\\\htdocs...')
#9 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\LoadConfiguration.php(39): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->loadConfigurationFiles(Object(Illuminate\\Foundation\\Application), Object(Illuminate\\Config\\Repository))
#10 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(219): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration->bootstrap(Object(Illuminate\\Foundation\\Application))
#11 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(320): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#12 [--Laravel-rout-path--]\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(129): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#13 [--Laravel-rout-path--]\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#14 {main}
"}
The cause of the error is:
error line 7 [--Laravel-rout-path--]\config\laravel-log-reader.php(6): url('shopadmin')
Commenting out this 6th line from the \config\laravel-log-reader.php the issue is resolving.
The issue is known: https://github.com/laravel/framework/issues/7671
The url() Laravel helper is not for use in the any_config.php files.
I suggest the change the package to do not use the url() helper function.
In the \config\laravel-log-reader.php by my opinion enough to use a simple string like '/admin' or '/shopadmin', or a rout name, and convert it to url in the view,