Download the PHP package levacic/laravel-whoops-editor-link without Composer
On this page you can find all versions of the php package levacic/laravel-whoops-editor-link. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-whoops-editor-link
Laravel Whoops editor link fixer
This tiny package rewrites the file link in Whoops's Pretty Page handler, when used within a Laravel project.
When running your project within a virtual machine, the links generated by Whoops will point to the file path within the virtual machine, which are inaccessible from your host environment. In order for these links to work, they must be rewritten so they would point to the correct file on the host machine. Using this package, it's easy to fix these links.
Installation
In your project root, do this:
Alternatively, you may specify whichever package version is currently available when you install the package, e.g. ~1.0.3
.
After that, publish the configuration file:
This will copy the configuration file into app/config/packages/levacic/laravel-whoops-editor-link/path.php
, and you should configure the appropriate paths for your environment.
For example, if your application on your host machine is located in /home/username/www/application
, and within your virtual machine, the application root is in /var/www/sites/application
, your configuration should look something like this:
However, if you do this, you'll have hardcoded application paths within your application repo, which is considered bad practice. The recommended way to configure this package is to configure the paths using Laravel's environment variables, naming the variables, for example, APP_ROOT_HOST
and APP_ROOT_GUEST
, and setting your configuration to use these:
Finally, you need to add the package's service provider to your app.providers
array:
Of course, for this to work, you need to also have the appropriate protocol handler configured on your system for subl://
links.
Compatibility
This package is written for Laravel 4.2, and at the time of this writing, Laravel 5.0 is not stable yet. When it's released, the package will also be updated (if needed) to work with it. Feel free to contact me if you need it, and I forgot about it!
Contributing
There's not really much to contribute here, due to the very specific scope of what this package does, but I guess we could add the same functionality for other editors - if anyone needs this, or wants to add the functionality, just open an issue or a pull request, and we'll fix it.
License
The package is licensed as open-source software under the MIT license.