I need to execute a stored procedure after my form submits data. I have the stored procedure working like I want it, and I have my form working properly. I just do not know the statement to execute the sp from laravel 5.
it should be something like this: execute my_stored_procedure. but I can not seem to find anything like that online.
Running the Microsoft SQL Server Stored Procedure (MS SQL Server) using PHP Laravel framework. If you are trying to run SP using Laravel Model then you can use following two approaches.
If incase you are passing the Varchar Parameter then use the following:
If you are just passing parameter which are of INT or BIGINT then this should work and you can get the return from SP:
Once the stored procedure is executed the values will be present in the
$submit
in the form of array, you need to loop through it and access the required columns.for Laravel 5.5
or
no parameter
for Laravel 5.4
if you want to pass parameters:
For version 5.5 use
CALL
:Try something like this
or
Try this for without parameters