/** * Define your route model bindings, pattern filters, etc. * * @param \Illuminate\Routing\Router $router * @return void */ public function boot(Router $router) { parent::boot($router); $router->bind('client', function ($value, $route) { $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20); $id = $hashids->decode($value)[0]; return Client::findOrFail($id); }); $router->bind('bank', function ($value, $route) { $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20); $id = $hashids->decode($value)[0]; return BankDetail::findOrFail($id); }); $router->bind('address', function ($value, $route) { $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20); $id = $hashids->decode($value)[0]; return Address::findOrFail($id); }); $router->bind('property', function ($value, $route) { $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20); $id = $hashids->decode($value)[0]; return Property::findOrFail($id); }); $router->bind('agreement', function ($value, $route) { $hashids = new Hashids('MySecretSalt*(&^%$eo&*^%&r', 20); $id = $hashids->decode($value)[0]; return RentalAgreement::findOrFail($id); }); // }