Closed tychovbh closed 4 years ago
@joelhy Tag 6.0 doesn't seem to have been added on packagist. Latest is 5.6.10 (as of time of writing).
@joelhy Can you also update the composer to 6.0? I can only download 5.6.10.
@krisanalfa is in charge of flipboxstudio/lumen-generator
's packagist account, I do not have privilege.
For now, please use develop branch by adding following code to your composer.json:
"repositories": [
{
"type": "git",
"url": "git@github.com:flipboxstudio/lumen-generator.git"
},
]
"require": {
"flipbox/lumen-generator": "dev-develop",
// ....... your other packages here
},
Then run composer install
I installed lumen-generator as explained above (version 6.0 on a fresh installation of Lumen 6.0) but keep getting the error "Call to undefined function Flipbox\LumenGenerator\Console\str_replace_first()" when I try to run any "make:xyz" function.
After a little bit of research I found that "str_replace_first()" is a helper function from laravel that's not available on Lumen's "helpers.php" but is called in "GeneratorCommand.php"'s "getPath()" function (and in "TestMakeCommand.php", too btw).
Could you please provide a fix for this? Anyways, great tool :)
A quick-and-dirty fix was to edit the "helpers.php" file in "vendor/laravel/lumen-framework/src" and to add string support at the top:
use Illuminate\Support\Str;
and add the "str_replace_first()" function manually:
if (! function_exists('str_replace_first')) {
/**
* Replace the first occurrence of a given value in the string.
*
* @param string $search
* @param string $replace
* @param string $subject
* @return string
*/
function str_replace_first($search, $replace, $subject)
{
return Str::replaceFirst($search, $replace, $subject);
}
}
@krisanalfa Please update packagist package.