php – How to pass a POST response parameter from laravel to Vue.js?


I have a Laravel method that allows me to create an object and save it in the database.

public function store (Request $ request) {
    $ this-> validate ($ request,[
        'id_ubicacion' => 'required',
        'id_tipo_inmueble' => 'required',
        'nomenclatura' => 'required',
        'descripcion' => 'max: 100'
    ]);

    $ createdProperty = Property :: create ($ request-> all ());

    return $ createdProperty-> id;
}

As you can see, the method returns a data to me.

I call this method using vue.js:

createProperty: function () {
            var url = 'properties';
            axios.post (url, {
                nomenclature: this.nomenclature,
                location_id: this.id_location,
                id_tipo_family: this.id_tipo_family,
                area: this.area,
                description: this.description,
                coefficient: this.coefficient,
                chip_catastral: this.chip_catastral,
                matricula_inmobiliaria: this.matricula_inmobiliaria
            }). then (response => {
                // Here I should catch the value returned by the laravel method
            })
        }

This done, I need to call the value that the laravel method returns to me and be able to use it in the vue component, but I do not know how to do this.