-
Notifications
You must be signed in to change notification settings - Fork 43
fix(panels): corrigir avatar e link de perfil no menu do usuário #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.x
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
|
|
||
| use App\Enums\FilamentPanel; | ||
| use App\Http\Middleware\SetApplicationLocale; | ||
| use Filament\Actions\Action; | ||
| use Filament\Http\Middleware\Authenticate; | ||
| use Filament\Http\Middleware\AuthenticateSession; | ||
| use Filament\Http\Middleware\DisableBladeIconComponents; | ||
|
|
@@ -55,6 +56,11 @@ public function panel(Panel $panel): Panel | |
| ThreadPage::class, | ||
| ProfilePage::class, | ||
| ]) | ||
| ->userMenuItems([ | ||
| 'profile' => fn (Action $action): Action => $action | ||
| ->label(__('app.user_menu.my_profile')) | ||
| ->url(ProfilePage::getUrl()), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- provider files ---'
for f in app/Providers/Filament/AppPanelProvider.php app/Providers/Filament/AdminPanelProvider.php; do
if [ -f "$f" ]; then
nl -ba "$f" | sed -n '1,120p'
else
printf 'missing: %s\n' "$f"
fi
done
printf '%s\n' '--- Filament references ---'
rg -n --hidden -g '!vendor' -g '!node_modules' 'class ProfilePage|ProfilePage::getUrl|->url\(|filament/filament|filament' app composer.json composer.lock 2>/dev/null | head -250
printf '%s\n' '--- tracked candidate files ---'
git ls-files | rg '(^|/)(ProfilePage|Page)\.php$|composer(\.json|\.lock)$|Filament.*Provider'Repository: he4rt/heartdevs.com Length of output: 10966 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- provider files ---'
for f in app/Providers/Filament/AppPanelProvider.php app/Providers/Filament/AdminPanelProvider.php app-modules/panel-app/src/Pages/ProfilePage.php; do
printf '\n### %s\n' "$f"
if [ -f "$f" ]; then
sed -n '1,180p' "$f'
else
printf 'missing\n'
fi
done
printf '%s\n' '--- locked Filament metadata ---'
sed -n '2220,2278p' composer.lock
printf '%s\n' '--- page/url call sites ---'
rg -n -C 4 'function getUrl|public static function getUrl|function url|->url\(' app-modules app composer.jsonRepository: he4rt/heartdevs.com Length of output: 240 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- provider files ---'
for f in app/Providers/Filament/AppPanelProvider.php app/Providers/Filament/AdminPanelProvider.php app-modules/panel-app/src/Pages/ProfilePage.php; do
printf '\n### %s\n' "$f"
if [ -f "$f" ]; then
sed -n '1,180p' "$f"
else
printf 'missing\n'
fi
done
printf '%s\n' '--- locked Filament metadata ---'
sed -n '2220,2278p' composer.lock
printf '%s\n' '--- page/url call sites ---'
rg -n -C 4 'function getUrl|public static function getUrl|function url|->url\(' app-modules app composer.jsonRepository: he4rt/heartdevs.com Length of output: 46334 🌐 Web query:
💡 Result: In Filament (including v5.7.6), the Citations:
🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
printf '\n### %s\n' "$url"
rg -n -C 8 'function getUrl|function url|setUrl|evaluate|register|routes|PanelProvider|userMenuItems' "$tmpdir/$out" || true
}
fetch 'https://raw.githubusercontent.com/filamentphp/filament/7e75d8da9b907ead7d618ce8237228316d08ae43/packages/panels/src/Pages/Page.php' page.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/da3ed6cc03bd604b8b875ea3d4e9ef02c279eb2/ packages/actions/src/Concerns/HasUrl.php' has-url.phpRepository: he4rt/heartdevs.com Length of output: 208 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
printf '\n### %s\n' "$url"
rg -n -C 8 'function getUrl|function url|setUrl|evaluate|register|routes|PanelProvider|userMenuItems' "$tmpdir/$out" || true
}
fetch 'https://raw.githubusercontent.com/filamentphp/filament/7e75d8da9b907ead7d618ce8237228316d08ae43/packages/panels/src/Pages/Page.php' page.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/da3ed6cc03bd604b8b875ea3d4e9ef02c279eb2/packages/actions/src/Concerns/HasUrl.php' has-url.phpRepository: he4rt/heartdevs.com Length of output: 208 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
if curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"; then
printf '\n### %s\n' "$url"
rg -n -C 8 'function getUrl|function url|setUrl|evaluate|register|routes|PanelProvider|userMenuItems' "$tmpdir/$out" || true
else
printf '\nFAILED %s\n' "$url" >&2
fi
}
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php' page.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/da3ed6cc03bd604b8b875ea3d4e9ef02c279eb2/packages/actions/src/Concerns/HasUrl.php' has-url-packages.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/da3ed6cc03bd604b8b875ea3d4e9ef02c279eb2/src/Concerns/HasUrl.php' has-url.phpRepository: he4rt/heartdevs.com Length of output: 2490 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
get_tree() {
repo="$1"
sha="$2"
curl -fsSL "https://api.github.com/repos/$repo/git/trees/$sha?recursive=1" |
jq -r '.tree[]?.path' > "$tmpdir/$(echo "$repo" | tr / _).tree"
printf '\n### %s\n' "$repo"
rg -i 'url|action|panelprovider|provider|route' "$tmpdir/$(echo "$repo" | tr / _).tree" |
rg 'HasUrl|Action|PanelProvider|Panel|ServiceProvider|Route' | head -150
}
get_tree filamentphp/actions da3ed6cc03bd604b8b875ea3d4e9ef02c279eb2
get_tree filamentphp/panels 7e75d8da9b907ead7d618ce8237228316d08ae43
printf '\n--- action lock metadata ---\n'
sed -n '2170,2220p' composer.lockRepository: he4rt/heartdevs.com Length of output: 3314 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
printf '\n### %s\n' "$url"
sed -n '1,260p' "$tmpdir/$out"
}
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/PanelProvider.php' panel-provider.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/FilamentServiceProvider.php' filament-service-provider.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Panel/Concerns/HasRoutes.php' panel-routes.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Action.php' action.phpRepository: he4rt/heartdevs.com Length of output: 21983 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
printf '\n### %s\n' "$url"
rg -n -C 12 'function registerPanel|function getPanels|function getPanel|function register|function boot|registerRoutes|userMenuItems|function url|function getUrl|evaluate' "$tmpdir/$out" || true
}
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/PanelRegistry.php' panel-registry.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/FilamentManager.php' filament-manager.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Panel/Concerns/HasComponents.php' panel-components.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php' can-open-url.phpRepository: he4rt/heartdevs.com Length of output: 16878 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
for spec in \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Panel.php panel.php' \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Panel/Concerns/HasComponents.php components.php' \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Concerns/HasRoutes.php page-routes.php'
do
url="${spec% *}"
out="${spec##* }"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
printf '\n### %s\n' "$url"
rg -n -C 20 'function register\(|registerRoutes|registerPages|pages|routes\(|getPages|boot\(' "$tmpdir/$out" || true
doneRepository: he4rt/heartdevs.com Length of output: 16526 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL 'https://api.github.com/repos/filamentphp/panels/git/trees/7e75d8da9b907ead7d618ce8237228316d08ae43?recursive=1' |
jq -r '.tree[]?.path' > "$tmpdir/tree"
printf '%s\n' '--- route-related paths ---'
rg -i '(^|/)(routes?|web|route|serviceprovider|provider)' "$tmpdir/tree" | head -200
printf '%s\n' '--- registerRoutes callers by source download ---'
while IFS= read -r path; do
case "$path" in
*.php)
url="https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/$path"
if curl -fsSL "$url" 2>/dev/null | rg -n -H -C 3 'registerRoutes\(' ; then
:
fi
;;
esac
done < "$tmpdir/tree"Repository: he4rt/heartdevs.com Length of output: 138 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
for path in routes/web.php src/routes/web.php src/Panel.php src/Panel/Concerns/HasComponents.php src/Http/Middleware/SetUpPanel.php; do
url="https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/$path"
if curl -fsSL --max-time 10 "$url" -o "$tmpdir/$(echo "$path" | tr / _)"; then
printf '\n### %s\n' "$path"
rg -n -C 12 'registerRoutes|registerPages|pages|resources|routes\(|getPanels|setCurrentPanel|bootCurrentPanel' "$tmpdir/$(echo "$path" | tr / _)" || true
fi
done
printf '\n--- tree paths containing route ---\n'
curl -fsSL --max-time 15 'https://api.github.com/repos/filamentphp/panels/git/trees/7e75d8da9b907ead7d618ce8237228316d08ae43?recursive=1' |
jq -r '.tree[]?.path' |
rg -i 'route|web' | head -100Repository: he4rt/heartdevs.com Length of output: 23404 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
}
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/PanelRegistry.php' registry.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/FilamentManager.php' manager.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/PanelProvider.php' provider.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/routes/web.php' routes.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php' page.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php' url.php
python3 - "$tmpdir" <<'PY'
from pathlib import Path
import re
import sys
root = Path(sys.argv[1])
text = {p.name: p.read_text() for p in root.iterdir()}
def pos(file, needle):
match = re.search(needle, text[file], re.S)
if not match:
raise AssertionError(f"{needle!r} not found in {file}")
return match.start()
# PanelProvider defers panel() until the registry callback is resolved.
assert "fn (): Panel => $this->panel(Panel::make())" in text["provider.php"]
assert "app(PanelRegistry::class)->register($panel)" in text["manager.php"]
# The route file resolves all panels before registering page routes.
panels = pos("routes.php", r"foreach \(Filament::getPanels\(\) as \$panel")
pages = pos("routes.php", r"foreach \(\$panel->getPages\(\) as \$page")
register_page = pos("routes.php", r"\$page::registerRoutes\(\$panel\)")
assert panels < pages < register_page
# Page::getUrl() invokes route() immediately.
get_url = text["page.php"][pos("page.php", r"public static function getUrl")]
assert "return route(static::getRouteName($panel), $parameters, $isAbsolute);" in get_url
# Action::url() stores the closure; getUrl() evaluates it later.
set_url = pos("url.php", r"public function url\(")
get_action_url = pos("url.php", r"public function getUrl\(")
assert set_url < get_action_url
assert "$this->url = $url;" in text["url.php"]
print("panel construction is deferred")
print("panel enumeration precedes page route registration")
print("Page::getUrl() calls route() immediately")
print("Action::url() stores closures for later evaluation")
PYRepository: he4rt/heartdevs.com Length of output: 246 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
fetch() {
url="$1"
out="$2"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
}
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/PanelRegistry.php' registry.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/FilamentManager.php' manager.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/PanelProvider.php' provider.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/routes/web.php' routes.php
fetch 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php' page.php
fetch 'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php' url.php
python3 - "$tmpdir" <<'PY'
from pathlib import Path
import re
import sys
root = Path(sys.argv[1])
text = {p.name: p.read_text() for p in root.iterdir()}
def pos(file, needle):
match = re.search(needle, text[file], re.S)
if not match:
raise AssertionError(f"{needle!r} not found in {file}")
return match.start()
assert "fn (): Panel => $this->panel(Panel::make())" in text["provider.php"]
assert "app(PanelRegistry::class)->register($panel)" in text["manager.php"]
panels = pos("routes.php", r"foreach \(Filament::getPanels\(\) as \$panel")
pages = pos("routes.php", r"foreach \(\$panel->getPages\(\) as \$page")
register_page = pos("routes.php", r"\$page::registerRoutes\(\$panel\)")
assert panels < pages < register_page
get_url = text["page.php"][pos("page.php", r"public static function getUrl")]
assert "return route(static::getRouteName($panel), $parameters, $isAbsolute);" in get_url
set_url = pos("url.php", r"public function url\(")
get_action_url = pos("url.php", r"public function getUrl\(")
assert set_url < get_action_url
assert "$this->url = $url;" in text["url.php"]
print("panel construction is deferred")
print("panel enumeration precedes page route registration")
print("Page::getUrl() calls route() immediately")
print("Action::url() stores closures for later evaluation")
PYRepository: he4rt/heartdevs.com Length of output: 246 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
for spec in \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/routes/web.php routes.php' \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php page.php' \
'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php url.php'
do
url="${spec% *}"
out="${spec##* }"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
done
python3 - "$tmpdir" <<'PY'
from pathlib import Path
import re, sys
root = Path(sys.argv[1])
for name in ("routes.php", "page.php", "url.php"):
s = (root / name).read_text()
print(f"\n### {name}")
for needle in (
r"foreach \(Filament::getPanels\(\) as \$panel",
r"foreach \(\$panel->getPages\(\) as \$page",
r"\$page::registerRoutes\(\$panel\)",
r"public static function getUrl",
r"public function url\(",
r"public function getUrl\(",
r"\$this->url = \$url;",
):
m = re.search(needle, s)
print(f"{needle}: {m.start() if m else 'NOT FOUND'}")
if m:
print(s[max(0, m.start()-80):m.start()+180].replace("\n", "\\n"))
PYRepository: he4rt/heartdevs.com Length of output: 2934 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
for spec in \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/routes/web.php routes.php' \
'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php page.php' \
'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php url.php'
do
url="${spec% *}"
out="${spec##* }"
curl -fsSL --retry 2 "$url" -o "$tmpdir/$out"
done
python3 - "$tmpdir" <<'PY'
from pathlib import Path
import re, sys
root = Path(sys.argv[1])
for name in ("routes.php", "page.php", "url.php"):
source = (root / name).read_text()
print(f"\n### {name}")
for pattern in (
r"foreach \(Filament::getPanels\(\) as \$panel",
r"foreach \(\$panel->getPages\(\) as \$page",
r"\$page::registerRoutes\(\$panel\)",
r"public static function getUrl",
r"public function url\(",
r"public function getUrl\(",
r"\$this->url = \$url;",
):
match = re.search(pattern, source)
print(f"{pattern}: {match.start() if match else 'NOT FOUND'}")
if match:
start = max(0, match.start() - 80)
end = match.start() + 180
print(source[start:end].replace("\n", "\\n"))
PYRepository: he4rt/heartdevs.com Length of output: 2934 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/routes/web.php' -o "$tmpdir/routes.php"
curl -fsSL 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php' -o "$tmpdir/page.php"
curl -fsSL 'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php' -o "$tmpdir/url.php"
python3 - "$tmpdir" <<'PY'
from pathlib import Path
import re
import sys
root = Path(sys.argv[1])
routes = (root / "routes.php").read_text()
page = (root / "page.php").read_text()
url = (root / "url.php").read_text()
app = Path("app/Providers/Filament/AppPanelProvider.php").read_text()
admin = Path("app/Providers/Filament/AdminPanelProvider.php").read_text()
panels = routes.index("foreach (Filament::getPanels() as $panel)")
page_routes = routes.index("$page::registerRoutes($panel)")
assert panels < page_routes
get_url = page[page.index("public static function getUrl"):page.index("public static function registerRoutes")]
assert "return route(static::getRouteName($panel), $parameters, $isAbsolute);" in get_url
url_setter = url[url.index("public function url("):url.index("public function postToUrl(")]
url_getter = url[url.index("public function getUrl("):url.index("public function shouldOpenUrlInNewTab(")]
assert "$this->url = $url;" in url_setter
assert "return $this->evaluate($this->url)" in url_getter
assert "->url(ProfilePage::getUrl())" in app
assert "->url(ProfilePage::getUrl(panel: FilamentPanel::App->value))" in admin
print("PASS: panel enumeration precedes page route registration")
print("PASS: Page::getUrl() calls route() immediately")
print("PASS: Action::url() stores its value and getUrl() evaluates it")
print("PASS: both repository call sites eagerly invoke ProfilePage::getUrl()")
PYRepository: he4rt/heartdevs.com Length of output: 394 🏁 Script executed: #!/bin/bash
set -eu
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/routes/web.php' -o "$tmpdir/routes.php"
curl -fsSL 'https://raw.githubusercontent.com/filamentphp/panels/7e75d8da9b907ead7d618ce8237228316d08ae43/src/Pages/Page.php' -o "$tmpdir/page.php"
curl -fsSL 'https://raw.githubusercontent.com/filamentphp/actions/5.x/src/Concerns/CanOpenUrl.php' -o "$tmpdir/url.php"
python3 - "$tmpdir" <<'PY'
from pathlib import Path
import sys
root = Path(sys.argv[1])
routes = (root / "routes.php").read_text()
page = (root / "page.php").read_text()
url = (root / "url.php").read_text()
app = Path("app/Providers/Filament/AppPanelProvider.php").read_text()
admin = Path("app/Providers/Filament/AdminPanelProvider.php").read_text()
panels = routes.index("foreach (Filament::getPanels() as $panel)")
page_routes = routes.index("$page::registerRoutes($panel)")
assert panels < page_routes
get_url = page[page.index("public static function getUrl"):page.index("public static function registerRoutes")]
assert "return route(static::getRouteName($panel), $parameters, $isAbsolute);" in get_url
url_setter = url[url.index("public function url("):url.index("public function postToUrl(")]
url_getter = url[url.index("public function getUrl("):url.index("public function shouldOpenUrlInNewTab(")]
assert "$this->url = $url;" in url_setter
assert "return $this->evaluate($this->url)" in url_getter
assert "->url(ProfilePage::getUrl())" in app
assert "->url(ProfilePage::getUrl(panel: FilamentPanel::App->value))" in admin
print("PASS: panel enumeration precedes page route registration")
print("PASS: Page::getUrl() calls route() immediately")
print("PASS: Action::url() stores its value and getUrl() evaluates it")
print("PASS: both repository call sites eagerly invoke ProfilePage::getUrl()")
PYRepository: he4rt/heartdevs.com Length of output: 394 Defer both profile URL evaluations.
📍 Affects 2 files
🤖 Prompt for AI Agents
cristopherpds marked this conversation as resolved.
Outdated
|
||
| ]) | ||
| ->middleware([ | ||
| EncryptCookies::class, | ||
| AddQueuedCookiesToResponse::class, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.