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 with direct Class access #82

Open
flatcapco opened this issue Apr 30, 2021 · 0 comments
Open

Bug with direct Class access #82

flatcapco opened this issue Apr 30, 2021 · 0 comments
Labels
bug Something isn't working to-review This solution seems to work

Comments

@flatcapco
Copy link

Hey I have a Room model and resource. It has a column value of "name"

The way I'm calling the code actually doesnt use the "name" column but the "title()" set on the room resource:

    public function title(): string
    {
        return $this->model()->property->name . ': ' . $this->model()->name;
    }

This code below was working fine for me until I updated:

BelongsToManyField::make('Rooms', 'rooms', Room::class),

However on the latest update I now have to do the following:

BelongsToManyField::make('Rooms', 'rooms', Room::class)->optionsLabel('name'),

Weirdly its still using the title() method to display the label.. (which is good for me) but without the options label it just spits an error out (its trying to assign the string (label) rather than id on save).

I'm using 1.9 .. previously was 1.8 I believe

@Benjacho Benjacho added bug Something isn't working to-review This solution seems to work labels Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to-review This solution seems to work
Projects
None yet
Development

No branches or pull requests

2 participants