Support the ongoing development of Laravel.io →
Eloquent Laravel Routing
Last updated 4 months ago.
0

Finally found the answer. I need to override resolveSoftDeletableRouteBinding method instead of resolveRouteBinding method like this:

Models/SoftDeletedModel.php

use SoftDeletes;

public function resolveSoftDeletableRouteBinding($value, $field = null) {
    dd("Successfully Substituted Bindings when using WithTrashed."); // This now works;
    return parent::resolveSoftDeletableRouteBinding($value, $field);
}
0
Solution selected by @dopesky

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

Kevin Mwenda dopesky Joined 3 Dec 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.