laravel - Error on POST Request -


i developing in laravel 5.3.

when reviewing routes, have following:

routers

here indicates routes post. if in postman enter url (post), throw following error

enter image description here

the strangest thing on local server works fine, error occurred me on production server.

my code is:

api.php

route::group(['middleware' => ['api', 'auth:api']], function() { require_once 'routes/api/productroute.php'; 

});

routes/routes/api/userroute.php

<?php  route::post('user/authenticate', [     'as' => 'api.user.authenticate',     'uses' => 'api\usercontroller@authenticate' ]);  route::post('user/register', [     'as' => 'api.user.register',     'uses' => 'api\usercontroller@register' ]); 

/app/http/controllers/api/usercontroller.php

public function authenticate(request $request)     {         $credentials = $request->only('email', 'password');          if (auth::attempt($credentials)) {             $user = auth::user();              \db::table('oauth_access_tokens')                 ->where('user_id', $user->id)                 ->where('name', $request->platform)                 ->update(['revoked' => 1]);              $token = $user->createtoken($request->platform)->accesstoken;             return controller::apiresponse(1, compact('user', 'token'));         } else{             return controller::apiresponse(-1);         }     } 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -