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

Nova Dependency Container Broke Readonly field #205

Open
pemudakoding opened this issue Apr 7, 2022 · 1 comment
Open

Nova Dependency Container Broke Readonly field #205

pemudakoding opened this issue Apr 7, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@pemudakoding
Copy link

I'd tried using Nova Dependency for the readOnly field, on my case, I want to show the field where the file isn't associated with the database columns so just need them only for external information. But Nova Dependency still executed them and tryin' to store or update to the database.

Current Code
image

I have a solution but I felt it needs a lot of costs, so I should workin' two times for making an external field that isn't associated with the database.
image

I think it's should be good if we only make it under Nova Dependency Container no need making again at another place.

@NoahNxT
Copy link
Contributor

NoahNxT commented May 1, 2022

@pemudakoding Could you try this? Because if you won't pass a function on the second parameter of a field it will indeed try to post it in the database, this is not an issue of Dependency container. Hopefully this helps!

            Text::make('Return URL', static function ($model){
                return route('payment.notify', $this->slug);
            })
            ->readonly()
            ->hideFromIndex(),

@NoahNxT NoahNxT added the question Further information is requested label May 1, 2022
@NoahNxT NoahNxT self-assigned this May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants