-1
I am trying to register a new user who is not on the route protected by middleware token jwt, but am getting the Return.
{
"error": "The token could not be parsed from the request"
}
Follows Routes/api.php file
Route::group(['middleware' => 'jwt.auth'], function(){
Route::resource('tipoDespesa', 'TipoDespesaController');
Route::resource('mudarTexto', 'MudarTextoController');
// Usuario
// Route::get('user', 'PessoaController@show');
// Route::put('user', 'PessoaController@update');
// Route::delete('user', 'PessoaController@destroy');
Route::resource('conta', 'ContaController');
Route::resource('categoria-despesa', 'CategoriaDespesaController');
Route::put('conta/ativar/{id}', 'ContaController@ativar');
Route::get('auth/me', 'AuthController@me');
});
Route::post('auth/login', 'AuthController@login');
Route::post('auth/logout', 'AuthController@logout');
Route::post('auth/refresh', 'AuthController@refresh');
Route::post('new/user', 'PessoaController@store');
Postman
Do not put image, put the complete code of this controller
– novic
Never do
$usuario->all()
when you’re still filtering, do$usuario->where('','')->get()
or$usuario->where('','')->count()
, for the filter to be written to SQL and run back from the database only what you need– novic
@Virgilionovic Thanks for the tip.
– Herick