Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lukegalea16's avatar

Call PHP Function from Laravel Blade View

I have an HTML Form in my Blade View and a Mail Function Setup in a php file (passing some parameters to this function will make an API call to SendGrid and send the mail). Is it possible to call that Mail Function when I press on submit in my HTML Form?

0 likes
1 reply
lukegalea16's avatar

I have found a workaround by placing a php file in my public assets. However can this php file be accessed by the public in some way? Since I have a Bearer Token stored in it for the API.

Please or to participate in this conversation.