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

Filament v3 upgrade : getRelations() not working anymore (view not found) #13969

Closed
Arachnos opened this issue Aug 16, 2024 · 2 comments
Closed

Comments

@Arachnos
Copy link

Arachnos commented Aug 16, 2024

Package

filament/filament

Package Version

v3.2.97

Laravel Version

v10.48.20

Livewire Version

v3.5.4

PHP Version

PHP 8.2.21

Problem description

Hi everyone,

I have updated Filament v2 to v3 and I am stuck on a problem "View [1] not found".

image

I am using this code below :

{
    protected static string $relationship = 'products';

    protected static ?string $recordTitleAttribute = 'name';

    public function form(Form $form): Form
    {
        return ProductResource::form($form);
    }

    public function table(Table $table): Table
    {
        return ProductResource::table($table)
            ->headerActions([
                Tables\Actions\CreateAction::make(),
            ])
            ->actions([
                Tables\Actions\EditAction::make(),
                Tables\Actions\DeleteAction::make(),
            ])
            ->bulkActions([
                Tables\Actions\DeleteBulkAction::make(),
            ]);
    }
}```

### Expected behavior

I need to display relationship of a model (Products attached to Adverts) in a list / table (see Filament v2 result in attachment).

![image](https://github.com/user-attachments/assets/fff220ba-4870-4a52-ace9-57b28dcc1d48)


### Steps to reproduce

Using `getRelation()` in Resource file : 

public static function getRelations(): array
{
return [
AdvertProductRelationManager::class
];
}


### Reproduction repository (issue will be closed if this is not valid)

https://github.com/filamentphp/filament

### Relevant log output

_No response_

<!-- POLAR PLEDGE BADGE START -->
### Donate 💰 to fund this issue

- You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
- 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
- Thank you in advance for helping us make maintenance sustainable!

<a href="https://polar.sh/filamentphp/filament/issues/13969">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/filamentphp/filament/issues/13969/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/filamentphp/filament/issues/13969/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->
@Arachnos Arachnos added bug Something isn't working medium priority unconfirmed labels Aug 16, 2024
Copy link

Hey @Arachnos! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

Copy link

Hey @polar-sh[bot]! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant