Closed larrydalaw closed 7 years ago
I am not sure that I fully follow what your doing.
What version of Laravel are you using? What version of Laravel-code-generator are you using? Also, are you using the default template or the default-collective?
Additionally, can you please clean your Laravel log file, rerun your code? Then please paste the entire log so I can trace th problem.
It may also be helpful to post your SsServices structure to help reproducing the error
@larrydalaw I think that you might have forgotten to run php artisan vendor:publish --provider="CrestApps\CodeGenerator\CodeGeneratorServiceProvider" --tag=default
before running the create:fields-file
command. That would cause this error since the config file is not in place (more specifically the eloquent_type_to_method
array is missing).
@jesperhag thanks for your input. @larrydalaw did you fix your issue?
Check your package.json
to see if it is valid JSON.
For instance, if you have a dangling comma after the last item in a bracket set {}, like...
"tailwindcss": "^3.0.18", }
it can cause a problem when you run an artisan command. It can give you an error much like
`ErrorException
array_key_exists() expects parameter 2 to be array, null given` A misplaced comma can confuse artisan into expecting one more thing.
When I Ran the
php artisan create:fields-file [table name]
at the first time it was perfectly good...php artisan create:fields-file ssDuty --translation-for=en,cn
thenphp artisan create:resources SsService --fields-file=ssService.json --table-name=ssService --table-exists --translation-for=en,cn --primary-key=sid --with-soft-delete --without-migration --force
So I wanted to re-do it again in a new environment using the same set of code and Table in a new laravel project and new mysql schema. However, I forgot to first require something likeSo it was not successful when i ran the same code above. So I installed them again and tried to run the same code but from this moment , the code returned the same error no matter what possibility i tried.
please help