Skip to content

Handle field name in route parameter #836

@blackjak231

Description

@blackjak231

Right now, the current localization system does not handle using field names in route parameters.

Example

Route definitions

french: /ville/{city:slug} --> default language
english: /city/{city:slug}

Using LaravelLocalization::getLocalizedURL() to get the english url, it will return /en/ville/{city:slug}.

After checking, it seems that when getting the attributes it ignores :slug and uses the key city and then tries to find {city} in the translated url to return it.

I wish to not use the route binding on my model as the id and other attributes are used in other places.

Thanks in advance !

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions