You can override the route binding resolver for each of your models. In this example, I have no control over the @ sign in the URL, so using the resolveRouteBinding method, I'm able to remove the @ sign and resolve the model.
// RouteRoute::get('{product:slug}', Controller::class); // Requesthttps://nodejs.pub/@unlock/hello-world // Product Modelpublic function resolveRouteBinding($value, $field = null){ $value = str_replace('@', '', $value); return parent::resolveRouteBinding($value, $field);}
Tip given by @Philo01
Enjoyed This Tip?
Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.
Recent Courses
[NEW] Building a Typical Laravel SaaS
11 lessons
1 h 36 min
Laravel Coding with AI Agents: Cursor, Claude Code, Codex
5 lessons
1 h 01 min
Claude Code for Laravel Projects: Crash Course
8 lessons
48 min