Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] add command show model to package #1429

Merged
merged 1 commit into from
Jul 29, 2022
Merged

[feat] add command show model to package #1429

merged 1 commit into from
Jul 29, 2022

Conversation

alissn
Copy link
Contributor

@alissn alissn commented Jul 28, 2022

This PR introduces a new module:model-show command that displays information for a model. It combines information from the database alongside information from Eloquent to give you a complete overview of your model. this command exclusively changed to this package.

more info about this Command : [9.x] Artisan model:show command #43156

only change qualifyModel method to find model name in Entities Folder.

@dcblogdev
Copy link
Collaborator

thanks for adding this, I've tried to use this on a local install but I'm getting:

php artisan module:model-show Action

ERROR Target class [Action] does not exist.

Can you test it out further and add a test

I'm testing a Laravel 9.22.1

@alissn
Copy link
Contributor Author

alissn commented Jul 29, 2022

hi, thanks for testing this command. i have some question:

  • where are your Action model path?
  • and Model namespace follow Psr-4?

this command search in Entities(get this Folder from config) folder with pattern:

config('modules.namespace') . DIRECTORY_SEPARATOR .
'*' . DIRECTORY_SEPARATOR .
config('modules.paths.generator.model.path') . DIRECTORY_SEPARATOR .
"$model.php")

it's expected your Action model path is :
Modules/{YourModelName}/Entities/Action.php

with this NameSpace :
namespace Modules\{YourModelName}\Entities;

@dcblogdev
Copy link
Collaborator

its working, I needed to change in my config:

'model'           => ['path' => 'Models', 'generate' => true],

As it was using the default entities, I use Models.

@dcblogdev dcblogdev merged commit 1be87cd into nWidart:master Jul 29, 2022
@alissn alissn deleted the ShowModelCommand branch July 30, 2022 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants