what I'm trying to do is a function in javascript that sends a simple data to a laravel controller and then upload it to the database, the problem I have is that until now I have not been able to find a way to send this data, always I get error 500.
Laravel Controller:
public function crearRegistro(Request $request){
$registro = new Registro();
$registro->indicador = $request->indicador;
$registro->save();
}
Javasript Function:
$scope.calculoIndicador = function(){
$http.post("/calculoIndicador")
.then(function(response) {
});
$scope.indicador = 5 +5;
alert('Se ha guardado correctamente');
}
view:
<input class="btn btn-success" style="" ng-click="calculoIndicador()"
type="submit" value="Enviar"/>
Route:
Route::post('/calculoIndicador', 'TecnologiaController@crearRegistro');
storage/logs/*.log(the file name may vary.) What does the trace say when your 500 occurred? They come with timestamps, so it should be easy to spot :)