filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.07k stars 2.83k forks source link

Documentation Integrating with an Eloquent relationship - relationshipName instead of name #7362

Closed jechazelle closed 1 year ago

jechazelle commented 1 year ago

Package

filament/filament

Package Version

v3.0.0

Laravel Version

v10

Livewire Version

No response

PHP Version

PHP 8

Problem description

Hi,

First, thank you for the v3! 🎉

On the documentation https://filamentphp.com/docs/3.x/forms/fields/select#integrating-with-an-eloquent-relationship, the arg name must be replaced by relationshipName:

Select::make('author_id')
    ->relationship(relationshipName: 'author', titleAttribute: 'name')

instead of

Select::make('author_id')
    ->relationship(name: 'author', titleAttribute: 'name')

Expected behavior

/

Steps to reproduce

/

Reproduction repository

/

Relevant log output

No response

github-actions[bot] commented 1 year ago

Hey @jechazelle! 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.

Also, it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.

danharrin commented 1 year ago

Hey, this isn't right, name is correct. Please check your Filament version php artisan about.

jechazelle commented 1 year ago

Hey @danharrin, right!

I had this:

composer show filament/filament

name     : filament/filament
descrip. : Effortlessly build TALL-stack apps and admin panels.
keywords : 
versions : * v3.0.0-alpha121
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : https://github.com/filamentphp/filament
source   : [git] https://github.com/filamentphp/panels.git 3e95304a8ae6edaec82be9ddc363bedbf1efbd1b
dist     : [zip] https://api.github.com/repos/filamentphp/panels/zipball/3e95304a8ae6edaec82be9ddc363bedbf1efbd1b 3e95304a8ae6edaec82be9ddc363bedbf1efbd1b
path     : /Users/dev/Dev/filamentphpv3/vendor/filament/filament
names    : filament/filament

support
issues : https://github.com/filamentphp/filament/issues
source : https://github.com/filamentphp/filament

autoload
files
psr-4
Filament\ => src

requires
danharrin/livewire-rate-limiting ^0.3|^1.0
filament/actions self.version
filament/forms self.version
filament/infolists self.version
filament/notifications self.version
filament/support self.version
filament/tables self.version
filament/widgets self.version
illuminate/auth ^9.0|^10.0
illuminate/console ^9.0|^10.0
illuminate/contracts ^9.0|^10.0
illuminate/cookie ^9.0|^10.0
illuminate/database ^9.0|^10.0
illuminate/http ^9.0|^10.0
illuminate/routing ^9.0|^10.0
illuminate/session ^9.0|^10.0
illuminate/support ^9.0|^10.0
illuminate/view ^9.0|^10.0
livewire/livewire ^2.10.7
php ^8.1
spatie/laravel-package-tools ^1.9
zepfietje commented 1 year ago

Make sure you're pulling in the stable release instead of the alpha.