Download the PHP package gbuckingham89/valet-assistant without Composer
On this page you can find all versions of the php package gbuckingham89/valet-assistant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gbuckingham89/valet-assistant
More information about gbuckingham89/valet-assistant
Files in gbuckingham89/valet-assistant
Package valet-assistant
Short Description A Laravel package for using Laravel Valet within another Laravel application - e.g. getting a list of sites served by Valet.
License MIT
Homepage https://github.com/gbuckingham89/valet-assistant
Informations about the package valet-assistant
Valet Assistant
A Laravel package for using Laravel Valet within another Laravel application - e.g. getting a list of sites served by Valet.
This package will only be fully functional when used on a computer that has Laravel Valet installed.
Looking for a UI for Laravel Valet? Take a look at gbuckingham89/valet-launchpad.
Installation
You can install the package via composer:
You can publish the Laravel config file with:
Usage
Use the Laravel container to resolve a copy of Gbuckingham89\ValetAssistant\ValetAssistant
however you feel is best - e.g. dependency injection or via app()->make()
.
There is also a Facade, Gbuckingham89\ValetAssistant\Facade\ValetAssistant
, if that's your preference.
Once you have your instance, you can use the following methods:
Get a list of all the projects served by Laravel Valet:
This returns a Collection of "Project" objects (representing a directory on your local machine). Each Project will have one or more "Site" objects (representing a URL that the project is served under). Take a look at the source code or use auto-completion in your IDE to learn more about the data structure.
Check is Valet is installed (and accessible):
This simply returns a boolean value indicating if Valet is installed, or not.
Troubleshooting
Valet not installed
If you see errors about Valet not being installed (but you're sure that it is, and you see output by running which valet
from your local terminal) it's likely that the user running your PHP script doesn't know where the Valet binary is located, or doesn't have permission to run it.
There are two ways to resolve this;
- Find the value of the PATH environment variable for your shell by running
echo $PATH
from your local Terminal. Ensure you have published the config file (see above), then add an entry to your.env
file with the keyVALET_ASSISTANT_ENV_PATH
and the value of your local PATH. This PATH value will then be used whenever this package executes a shell command. It is NOT used by code outside this package. - Add
/Users/[local-username]/.composer/vendor/bin
to the PATH environment for the user running the PHP script (remember to insert the username that Valet is installed under)
Please do your own research and consider any security implications of giving PHP access to additional directories through the PATH environment.
Testing
You can run the test suite by calling ./vendor/bin/phpunit
or composer test
.
You may see the following error in your terminal output when running the test suite: ..sh: which: command not found
. This is a known issue and a PR to resolve this would certainly be welcomed!
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- George Buckingham
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of valet-assistant with dependencies
ext-json Version *
laravel/framework Version ^8.0
spatie/enum Version ^3.11
laravel/valet Version ^2.18