jefsev
03/09/2023, 8:04 PMpublic function resolveRouteBinding($slug, $field = null)
{
if (str_contains($slug, '/')) {
// Get the last part of the nested slug.
$slug = strrchr($slug, '/');
// Remove the leading slash.
$slug = ltrim($slug, '/');
// Remove all forward slashes.
$slug = str_replace('/', '', $slug);
// $lastPart now contains the last part of the nested slug without any slashes.
}
$page = app(PageRepository::class)->forSlug($slug);
abort_if(! $page, 404);
return $page;
}
->forNestedSlug($slug); is not working when there i a parent\child\grandchild for me. Now it seems to work as in the db the actual page title slug is the one there