I am trying to pass the data from the stored procedure, from the controller, but I don't know what is generating an error, which only creates the record in the table that I want, but does not save any data in the table.
AP:
CREATE PROCEDURE movimientos_stock (
IN usuario_fk BIGINT,
IN producto_fk BIGINT,
IN area_fk BIGINT,
IN tipo_area_fk BIGINT,
IN tipo_movimiento VARCHAR(100),
IN created_at DATETIME)
BEGIN
INSERT INTO `movimientos`(usuario_fk, producto_fk, area_fk, tipo_area_fk, tipo_movimiento, created_at)
VALUES (usuario_fk, producto_fk, area_fk, tipo_area_fk, tipo_movimiento, created_at);
END;
CONTROLLER
In the controller I use it like this:
DB::unprepared("CALL movimientos_stock($usuario_fk, $producto_fk, $area_fk, $tipo_area_fk, $tipo_movimiento, $created_at)");
The variables I am adding are already declared and if they are receiving the data I need.
As you can see, it registers me, but it doesn't save anything.