outl1ne / nova-multiselect-field

A Laravel Nova package that adds a multiselect to Nova's arsenal of fields.
MIT License
332 stars 120 forks source link

Is not compatible with Nova v4.32.14 #255

Open andevit opened 7 months ago

andevit commented 7 months ago

Please can you upgrade?

KasparRosin commented 4 months ago

@andevit Is this still an issue and could you elaborate? I' using it along the latest nova and it's working.

ColisSan commented 1 month ago

I also encountered an issue while using the newest (4.35.2) nova version. The issue happens when I try to assign a model to another model. (In my case a Permission to a Role). The view works ok. On detail, I get a list of permissions that were attached to the Role model.

Until I downgraded my laravel-nova version from 4.35.2 to 4.35.0 I kept getting 404 from the nova-api route that returns the queried values.

I'm using the Multiselect field on my Role nova resource:

public function fields(NovaRequest $request)
{
    return [
        Text::make('Ime', 'name'),
        HasMany::make('Korisnici', 'users', User::class),
        Multiselect::make('Dozvole', 'permissions')->options(Permission::pluck('name','id'))->belongsToMany(NovaPermission::class)
    ];
}

The Role and Permission models are just extended models from Spatie/laravel-permissions, but barely have any code except for static properties in Role model. (This occurs also in my other models)

I noticed the 404 error gets thrown during the invocation of the Laravel\Nova\Http\Controllers\AssociatableController, as if it doesn't recognize the property as my model's property.

Hope this helps. As I mentioned, I "fixed" this by downgrading the laravel-nova version to 4.35.0

vilhelmjosander commented 1 month ago

I have exactly the same problem. Downgrading to 4.35.0 resolves the issue for now.