Lumen blocks only one route in CORS, all others run

-2

I have a system that was working, but suddenly it stopped working. "I've been using Lumen with the package barryvdh / laravel-cors, 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 get the request through the route that forwards 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
    
asked by anonymous 30.07.2018 / 13:37

1 answer

-2

I was able to fix it, it was a problem in the configuration of the email in the AppService provider, because whenever I insert a record an email is sent and I was returning an error in this configuration

    $this->app->configure('mail');
    $this->app->singleton('mailer', function(Application $app){
        $app->loadComponent('mail', MailServiceProvider::class, 'mailer');
    });

I changed to:

    $this->app->configure('mail');
    $this->app->alias('mailer',Mailer::class);
    
30.07.2018 / 14:43