Skip to content
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

[Bug]: Route [filament.admin.resources.albums.index] not defined. #41

Open
kaustuv90 opened this issue Aug 1, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@kaustuv90
Copy link

What happened?

Route [filament.admin.resources.albums.index] not defined.

Guava\FilamentNestedResources\Pages\CreateRelatedRecord.php
`protected function getRedirectUrl(): string
{
$resource = $this->getNestedResource($this->getRecord());

    if ($resource::hasPage('view') && $resource::canView($this->getRecord())) {
        return $resource::getUrl('view', ['record' => $this->getRecord(), ...$this->getRedirectUrlParameters()]);
    }

    if ($resource::hasPage('edit') && $resource::canEdit($this->getRecord())) {
        return $resource::getUrl('edit', ['record' => $this->getRecord(), ...$this->getRedirectUrlParameters()]);
    }

    return $resource::getUrl('index');
}`

It seems when I remove the index page as mentioned in demo page it shows a error in create page it will try to find the index page and shows a error.

How to reproduce the bug

remove index and create page

Package Version

1.2.0

PHP Version

8.3.8

Laravel Version

11.14.0

Which operating systems does with happen with?

No response

Notes

No response

@kaustuv90 kaustuv90 added the bug Something isn't working label Aug 1, 2024
@kaustuv90 kaustuv90 changed the title [Bug]: [Bug]: Route [filament.admin.resources.albums.index] not defined. Aug 1, 2024
@kaustuv90 kaustuv90 reopened this Aug 1, 2024
@lukas-frey
Copy link
Contributor

You should only remove them from the child nested resources, not the root one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants