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

use native schema methods to get model's columns #119

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ryssbowh
Copy link

This fixes #70 by removing the calls to doctrine and use the native laravel schema methods

@Johannes-lindbak
Copy link

Can confirm that this commit fixed my issues

@mechelon mechelon changed the base branch from master to dev March 11, 2025 12:15
Copy link
Member

@mechelon mechelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments - and also note that this PR removes compatibility for Laravel < 10. But since Laravel 9 is EOL since over a year, I think it's fine.


if (config('erd-generator.use_db_schema')) {
$columns = $this->getTableColumnsFromModel($model);
foreach ($columns as $column) {
$label = $column->getName();
$label = $column['name'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if array key exists

if (config('erd-generator.use_column_types')) {
$label .= ' ('.$column->getType()->getName().')';
$label .= ' (' . $column['type'] . ')';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if array key exists

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.

Database entity blank
3 participants