orlyapps / nova-belongsto-depend

Larave Nova BelongsTo Field with Dependcy
MIT License
182 stars 65 forks source link

Unable so set readonly #62

Open sirikkoster opened 4 years ago

sirikkoster commented 4 years ago

Laravel Version: ^6.0 Nova Version: 2.12.0 Nova belongsto Depend: ^2.0


NovaBelongsToDepend::make('Relation Field', 'relation', Relation::class)
    ->readonly(function (NovaRequest $request)
    {
        return $request->isUpdateOrUpdateAttachedRequest();
    });
sirikkoster commented 4 years ago

What's the status on this modification?

issour commented 4 years ago

Hi ! same issue here ! thx :)

babul commented 4 years ago

Ah just ran into this myself. Would love to see readonly support as noted by @sirikkoster!

orlyapps commented 4 years ago

Hello, thanks for the issue. Feel free to add a pull request. I can merge it asap.

warksit commented 3 years ago

Not pretty but a workaround:

            NovaBelongsToDepend::make('Client')
                ->options(\App\Models\Client::all())
                ->hideWhenUpdating(),

            BelongsTo::make("Client")->readonly(function ($request) {
                return $request->isUpdateOrUpdateAttachedRequest();
            })->hideWhenCreating()->hideFromIndex(),
LeandroGCruzP commented 1 year ago

same issue 😢