feelgoodinc
03/09/2023, 2:13 PMifox
03/09/2023, 4:14 PMtiptap
which is becoming the default in Twill 3ifox
03/09/2023, 4:17 PMjefsev
03/09/2023, 7:06 PMjefsev
03/09/2023, 7:07 PMjefsev
03/09/2023, 7:10 PMpublic function resolveRouteBinding($slug, $field = null)
{
$page = app(PageRepository::class)->forNestedSlug($slug);
abort_if(! $page, 404);
return $page;
}
// #region routekey
public function getLocalizedRouteKey($locale)
{
return $this->getNestedSlug($locale);
}
And combining that with whats told on https://twill.io/docs/3.x/crud-modules/nested-modules.html#self-nested-modules here, but i cant make it work 😮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 thereifox
03/09/2023, 8:05 PMifox
03/09/2023, 8:05 PMjefsev
03/09/2023, 8:08 PMAntonyPL
03/09/2023, 10:45 PMifox
03/09/2023, 10:47 PMAntonyPL
03/09/2023, 10:49 PMifox
03/09/2023, 10:51 PMAntonyPL
03/09/2023, 10:52 PMAntonyPL
03/09/2023, 10:53 PMifox
03/09/2023, 10:54 PMifox
03/09/2023, 10:54 PMAntonyPL
03/09/2023, 11:05 PMAntonyPL
03/09/2023, 11:09 PMMD
03/10/2023, 1:19 AMifox
03/10/2023, 1:23 AMMD
03/10/2023, 1:24 AMMD
03/10/2023, 1:24 AMMD
03/10/2023, 1:24 AMifox
03/10/2023, 1:26 AMifox
03/10/2023, 1:27 AMMD
03/10/2023, 1:27 AMMD
03/10/2023, 1:28 AMMD
03/10/2023, 1:30 AM