Upload multiple files to S3 on Laravel Vapor with Dropzone.js

For a startup project in Laravel we’ll be launching soon I need to upload multiple files. With our AWS hosted stack deployed via Laravel Vapor the logical choice for storage is S3. To keep the load off our lambda “backend” I want it to upload to S3 straight from the browser using pre-signed URLs. For the frontend functionality I chose Dropzone because I have experience with it from previous projects.

I’m assuming you have an AWS account and permission setup with your access key and bucket configured in your .env and vapor.

At the end of this post we will have a drag-and-drop multi-file uploader directly to S3 using Vapor functionality.

Read More

Keep Nested Resource Routes Succint With The Shallow Option

I just got my first PR merged into Laravel! It adds the option for shallow resource routes. You can see the PR here.

Without any prior knowledge of Laravel internals this feature took me about an hour to develop. Props to the Laravel maintainers for an easy to navigate codebase and quick PR resolution!

Shallow Nesting

It’s a good practice not to nest resources too deep. Routes and their url helpers quickly get unwieldy. Shallow nesting is a way to prevent deep nesting of resources. Collection actions (index, new, create) are scoped to the parent to provide context, while member actions (show, edit, update, destroy) are placed in the root or namespace when provided. This strikes a nice balance between being descriptive and being compact. An additional advantage is that records will have a single canonical route.

Read More

You're up and running!

Next you can update your site name, avatar and other options using the _config.yml file in the root of your repository (shown below).

Read More