Closed GGH-Bortels closed 6 years ago
No, I don't thinks so. You could write a small script that swaps the trait file to an empty trait and another one that does the reverse.
May u explain this a little further?
Like so:
Create an empty trait file:
$ mkdir storage/tmp
<?php
// storage/tmp/empty.php
namespace Balping\HashSlug;
trait HasHashSlug {
}
Copy the original one to this directory
$ cp vendor/balping/laravel-hashslug/src/HasHashSlug.php storage/tmp/real.php
Then you can easily switch between the two:
testmode.sh
:
#!/bin/bash
cp -uf storage/tmp/empty.php vendor/balping/laravel-hashslug/src/HasHashSlug.php
realmode.sh
:
#!/bin/bash
cp -uf storage/tmp/real.php vendor/balping/laravel-hashslug/src/HasHashSlug.php
Moved to Gitlab. Issue has also been migrated: https://gitlab.com/balping/laravel-hashslug/issues/10 Continue there if necessary.
Hey,
It would be super awesome to disable the package in development. If I would have an option in the config with "enabled" or so I can debug much better. I don't know a quick hack for this because you can not include traits dynamically in PHP. Is there an exact code line where a quick and dirty "return" disables the whole package?