Closed Banzai292 closed 3 years ago
table eg: my_models
command:
php artisan krlove:generate:model MyModel --namespace=MyNameSpace
result:
[Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "krlove:generate" namespace.
The reason for the error:
Incorrect entry or no entry in config / app.php - section 'providers'
Krlove\EloquentModelGenerator\Provider\GeneratorServiceProvider::class
Ensure you've added the provider below in the config/app.php folder and ensure your table exists. 'providers' => [ // ... Krlove\EloquentModelGenerator\Provider\GeneratorServiceProvider::class, ];
in my case (using "laravel/lumen-framework": "5.8.*"), the solution needed GeneratorServiceProvider to be add on config/app.php but in another way : $app->register(\Krlove\EloquentModelGenerator\Provider\GeneratorServiceProvider::class);
then please check out your owner table PG, first i create table using PGAdmin but owner to postgree, i need to rename with targeted user PG, before using command created table.
I follow the instructions until Step 2, that is not clear enough, where to put this line. My environment (Windows 7 Pro x64):
I've created a test project with
These are the installed versions I got:
(BTW: all in Visual Studio Code Terminal with project 'cd' into project directory. Extensions 'Composer' and 'PHP Extension Pack')
I found the "provider= ["-thingi in 'composer.lock' and 'vendor\composer\installed.json, but without '::class', written from installation, I think.
The file 'GenerateModelComposer.php' (and many more) are available in project directory (.\vendor\krlove\eloquent-model-generator... etc)
My database connection is NOT on localhost, but on a verified extern accessible PostgreSQL 10 (I've successful connections from local development system to this database with pgDbAdmin or DBeaver). I activate the extension in my php.ini (single php_pdo_pgsql.dll and php_pgsql.dll and both)
But generation fails:
I try all variations of the --table-name option: with quotes, without quotes, with schema.table or schema."table", but this seems not to be the problem.
I'm out of ideas, what to do next.