I am developing an application with Laravel and angular, I am bringing the data with Laravel and I show them with Angular.
Controller in laravel:
public function ListadoDimensiones(){
$dimensiones = Dimension::with(['categorias' => function($q){
$q->with(['propiedades'=>function($r){
$r->with(['variables'=>function($s){
$s->with('intervalostec');
}]);
}]);
}])->get();
return $dimensiones;
}
This is how I bring the data with javascript:
var app = angular.module('myApp', []);
app.controller('dimensionesCtrl', function($scope, $http) {
$scope.variables = [];
$http.get("/listadoDimensiones")
.then(function(response) {
$scope.dimensiones = response.data;
});
All the above is the way to bring the data with laravel and angular, I would like to know how I could create a function either in the laravel driver or in javascript to Angular to update the data displayed in the database.
Thanks for your time.