13

I am building a system that uses Laravel Nova for managing resources.

There are a couple of instances where I want non-admin users to be able to create resources. The ideal solution would be to define the resource in Nova and embed Nova's own create form on the front end of the site.

Has anyone done anything similar, or have any suggestions how to go about this?

rhoward
  • 183
  • 2
  • 15
  • 3
    What about giving users access to nova backend and setup Laravel policies to let them access and create only those few resources that you want? – mdexp Feb 15 '20 at 17:05
  • That's not going to cut it unfortunately - it would be a very odd user journey for people to suddenly find themselves in the Nova backend. – rhoward Feb 17 '20 at 13:03

1 Answers1

1

I believe you can use the same endpoints that Nova is using.

For example to get all the fields of a resource:

GET updating fields: http://{url}/nova-api/{resource}/{id}/?editing=true&editMode=update

GET creation fields: http://{resource}/nova-api/{resource}/creation-fields?editing=true&editMode=create=

After the user has filled out the fields, you can use this endpoint to save the new values:

PUT: http://{url}/nova-api/{resource}/{id}

Rosin
  • 141
  • 1
  • 5