Custom Drivers
You can extend Herd with your own drivers to support customized setups of supported frameworks or to add new frameworks and applications that Herd doesn’t support out of the box. You can also change the application information tab in the Site Manager or add additional log file directories for the Log Viewer.Creating a driver
Herd internally leverages a heavily customized version of Laravel Valet for serving sites, and it includes all drivers that Valet provides. These drivers are a good start when creating your own custom driver, and it often makes sense to further extend them than starting from scratch.Please make sure to name the custom driver according to the driver convention. It needs to end on
ValetDriver.php
and a good name for a custom Laravel driver would be MyLaravelValetDriver.php
.Customize Herds behaviour
Log paths
You can customize the paths where the log viewer looks for log files by adjusting thelogFilesPaths()
method in the driver. The default looks like this:
Application Information
The Site Manager shows a tabular overview of your application in the information tab and you can customize this information to your needs. The default for Laravel applications is the output of thephp artisan about
command.
If you want to customize the overview table, you can do so by defining this method in your applications’ custom driver and returning an array like the following:
Custom Laravel Driver Example
This example of a custom driver extends the existing Laravel Driver and modifies it to serve the application from aweb
instead of the public
directory.
phpBinary
and $sitePath
variables.