-2
I have a system that was working, but suddenly it stopped working. Giving error "No 'Access-Control-Allow-Origin' header is present on the requested Resource" Etou using Lumen with barryvdh/Laravel-Cors package, the whole site works except for a public form that gives me this error.
The request is made through Angular:
insert (data: Object) {
let observable = this.http.post(this.url, data, this.requestOptions.merge(new RequestOptions()));
return this.toPromise(observable);
}
In Lumen I receive the request through the route that forwards to this function:
public function store(Request $request){
$this->validate($request, $this->rules ?? [], $this->messages ?? []);
$result = $this->model->create($request->all());
return response()->json($result);
}
insira o código aqui