Comments (3)
The output should have a caret (^
) before the dump, which will allow you to click through to open the file / line number in your editor. However, if you want to replicate the experience of Laravel exactly, you should be able to add the following to your AppServiceProvider::register()
method:
public function register(): void
{
$basePath = $this->app->basePath();
\Illuminate\Foundation\Console\CliDumper::register($basePath, null);
}
from laravel-zero.
Thanks for the code + explaination, but it is not exactly the same yet:
// in laravel-zero + your code in register
// app/Commands/GenerateMatchingSentenceCommand.php
// in laravel
// app/Commands/GenerateMatchingSentenceCommand.php:14
The line number was missing (it was the best part!).
And since this is a really neat feature, do you think it deserve to be in laravel-zero by default?
from laravel-zero.
Ok, that's my bad. I thought the compiled view path could be made null
to skip it, however you'll need to use:
public function register(): void
{
$basePath = $this->app->basePath();
$compiledViewPath = $this->app['config']->get('view.compiled', \Illuminate\Support\Str::random());
\Illuminate\Foundation\Console\CliDumper::register($basePath, $compiledViewPath);
}
So the problem is, if the path gets detected as starting with the compiled view path (e.g. ''
for when it's null
), then the line number gets ignored. If you're not using views at all (for something like Termwind), this path needs to be set to something random instead (like... Str::random()
, or sys_get_temp_dir()
). Otherwise it will remove the line number from all dumps.
I guess this could be added in to Laravel Zero, it's just a case of ensuring it's clean and won't cause any issues.
from laravel-zero.
Related Issues (20)
- Undefined constant "SIGINT" HOT 2
- Failed to open stream: phar error: Cannot open phar archive
- Consider using Laravel Prompts HOT 3
- New Project doesn't work "Undefined variable $command" HOT 2
- [BUG] self-update from github releases not working HOT 1
- Cannot find sqlite database when upgrading HOT 3
- app:build ErrorException rename(app.phar, builds/app): the system cannot find the file specified (code 2) HOT 3
- Failing builds: "database/factories" and "database/seeders" was expected to exist HOT 1
- app:build gives the error: The system cannot find the file specified (code: 2) HOT 4
- Why is package auto-discovery is off ? HOT 4
- Site https://laravel-zero.com is down HOT 1
- website down/expired. Is this project still being worked on? HOT 1
- Website is down - domain expired? HOT 3
- laravel-zero.com is down HOT 1
- Website is not working anymore http://laravel-zero.com/ HOT 3
- Global Composer installation without commiting binary to version control?
- Using DB pagination methods inside a command throws an exception HOT 1
- On Windows, when running app:build "impossible find specified file" HOT 5
- QUEUES Call to undefined method Psr\Log\NullLogger::driver()
- Composer Warnings when installing pest-plugin-laravel HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-zero.