Support the ongoing development of Laravel.io →
Eloquent Laravel Routing
Last updated 2 years 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!

Eventy

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?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.