Skip to content

Instantly share code, notes, and snippets.

@diego3g
Created July 17, 2018 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diego3g/81d69911296fc00af08c2524e2bf0df7 to your computer and use it in GitHub Desktop.
Save diego3g/81d69911296fc00af08c2524e2bf0df7 to your computer and use it in GitHub Desktop.
async update ({ params, request, response }) {
const property = await Property.findOrFail(params.id)
const data = request.only([
'title',
'address',
'latitude',
'longitude',
'price'
])
property.merge(data)
await property.save()
return property
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment