lasallesoftware-serverless/sample-lambda-create-form-with-illuminate-view-package

Sample PHP Lambda function to create a Blade form with the Illuminate view package, made with the Serverless Framework and Bref

dev-master 2023-05-02 15:45 UTC

This package is auto-updated.

Last update: 2024-03-02 17:57:06 UTC


README


Sample PHP Lambda function to render a Blade form, made with the Illuminate view package, without mounting an entire Laravel Framework web app. Made with the Serverless Framework and Bref


Quick Shpiel


When I first looked at using Lambda, the number one thing I really wanted to know was: could I render a Blade form without mounting an entire Laravel Framework web app. This would be so fan-tan-bu-lous-ly helpful that this ability alone would be worth learning Lambda (oh...it is true... be careful what you wish for).

I had never tried to render a Blade form on its own before, incredibly, but I was sure that it could be done. And, if it could be done, could it be done on Lambda? And, if it could be done on Lambda, could it be done without having to physically set up the production environment?


(i) Could I render a Blade form by composer installling individual Illuminate packages? Yes.

I did a video about using individual Illuminate packages, at https://phpserverlessproject.com/video/app-less-laravel-keeping-it-classy.


(ii) Could I render a Blade form thusly on Lambda? Yes.

Which led me to write this blog post: https://phpserverlessproject.com/lambda-writable-folder-tmp.


(iii) Could it be done on Lambda without having to physically set up prod? Yes.

Props to Matt Stauffer's Kick-Ass "Torch" Repo!


A very special thank you to Matt Stauffer for putting together his "Torch" repo. It was well after midnight, I couldn't quite get the rendering to work, and I vaguely remembered reading about someone figuring out how to use pieces of the Laravel Framework, without launching the Framework in an app. So I searched. I found Matt's Torch repo, and successfully rendered a Blade form using his "view component".

It worked so well that I created a repo to adapt Torch's view component, to streamline the code for specific use on Lambda.


Links



Copyright and License


lasallesoftware-serverless/sample-lambda-create-form-with-illuminate-view-package is copyright © The South LaSalle Trading Corporation and licensed for use under the MIT License (MIT).

Please see LICENSE for more information.

As reference, there is a wonderful blog post called The MIT License, Line by Line -- 171 words every programmer should understand.




THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.