Skip to content

Fix constant names on casts and fillable#262

Open
paulohenriquesg wants to merge 1 commit intoreliese:v1.xfrom
paulohenriquesg:v1.x-1
Open

Fix constant names on casts and fillable#262
paulohenriquesg wants to merge 1 commit intoreliese:v1.xfrom
paulohenriquesg:v1.x-1

Conversation

@paulohenriquesg
Copy link
Copy Markdown

Use case: the field name is idAdmin.

Before, the generated code was:

...
	const ID_ADMIN = 'idAdmin';
...
	protected $casts = [
		self::IDADMIN => 'int', // <- wrong constant
	];

After, it is:

...
	protected $casts = [
		self::ID_ADMIN => 'int'
	];

Use case: the field name is `idAdmin`.

Before, the generated code was:

```
...
	const ID_ADMIN = 'idAdmin';
...
	protected $casts = [
		self::IDADMIN => 'int', // <- wrong constant
	];
```

After, it is:

```
...
	protected $casts = [
		self::ID_ADMIN => 'int'
	];

```
@paulohenriquesg paulohenriquesg changed the title Fix constante names on casts and fillable Fix constant names on casts and fillable Aug 3, 2023
Copy link
Copy Markdown

@Rene-Welbers Rene-Welbers left a comment

Choose a reason for hiding this comment

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

had the same issue. this fixed it

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