Closed vesper8 closed 1 year ago
In the rebuild of Valet for v4, support for Extensions was set aside in the interest of getting the core functionality released.
You can manually reinstate the Extensions feature with a direct edit to the Valet source files, as shown below.
~/.config/valet/Extensions
directory.~/.composer/vendor/laravel/valet/cli/valet.app
as shown here:
require_once __DIR__.'/app.php';
+
+$extensions = glob(VALET_HOME_PATH . '/Extensions/*.php');
+foreach ($extensions as $extension) {
+ require_once $extension;
+}
/**
Since the affected file won't likely be touched by most future minor releases, you probably won't have to redo this very often.
But you probably will be prompted by Composer to keep/delete/stash your changes every time you run composer global update
to upgrade your Valet. Just choose "stash", and it should successfully stash and pull and unstash the updates without difficulty, since this file is unlikely to be touched.
Your existing Extensions for Valet 3 will most likely work fine on Valet 4, unless they were using features of $app
that have changed over time. Again, unlikely.
AND, as before, any Extensions that add commands whose names match (ie: clash with) Valet's own commands, will replace Valet's originals with yours. Not recommended. But if you were doing that before, you may want to upgrade your commands to newer syntax/features in cli/app.php
and re-apply your customizations.
And if your custom commands had cloned any Valet commands and then added/changed functionality of them, double-check the originals to see if there are any updates to apply to your cloned commands.
Thank you so much @drbyte !
It would be nice if extensions could be reinstated.. especially if doing so is as simple as suggested above..
Right now we don't have any plans to reinstate those sorry. But it seems to be easy to do so yourself 👍
Description
I made a post about two years ago https://github.com/laravel/valet/issues/1067
In which I asked how it would be possible to append a path to the url when using
valet open
and I received lots of good responses which all revolved around creating an extension to accommodate this.@drbyte gave me an excellent snippet of code that I've used ever since https://github.com/laravel/valet/issues/1067#issuecomment-859213590
Now I just upgraded to v4 and noticed my extensions stopped working. I don't actually see any notes in the v4 release saying that extensions were affected, I do notice that extensions are no longer mentioned in the Laravel docs.
Was this dropped? Is there a workaround?
I want to be able to alias a command such as
nova
which will usevalet open
to open the current site and append/nova/resources/users
to the opened URL.Would love to know how I can continue to achieve this feature that I use multiple times a day.
Many thanks
Steps To Reproduce
See above
Diagnosis
not relevant