S3 Bucket CORS Error With Laravel File Upload

If you get a CORS error when you are uploading to AWS S3 bucket from Laravel, do the following: [ { “AllowedHeaders”: [ “*” ], “AllowedMethods”: [ “GET” ], “AllowedOrigins”: [ “http://my-local-site.local” ], “ExposeHeaders”: [ “x-amz-server-side-encryption”, “x-amz-request-id”, “x-amz-id-2” ], “MaxAgeSeconds”: 3000 }] The AllowedMethods prop You can add other HTTP methods here. The PATCH method … Read more

[Guest post] Why I Decided To Embrace Laravel – Oleksii Rytov

Over the last year, I took part in three large projects. My task was to move away from the old architecture based on PHP and server-side HTML generation, and transition to REST API. With the old approach, back-end developers were expected to know much more about the UI and visual aspects of the application. Because … Read more

Catch TokenMismatchException thrown by VerifyCsrfToken in Laravel

If you are using Laravel 5, you must have come across something like this when a form wasn’t after a long period of time of opening the page.   This was meant to help with checking against CSRF but it can be really annoying seeing this. Most of your user/visitors don’t understand the gibberish written, and … Read more

Bind multiple models to a form in Laravel 5 and validate it

Form model binding in Laravel 5 makes the programmers’ live easier, no doubt. But what if you want to bind multiple models to a form? This is not straight forward but it’s not so complex either. (May be it was till I cracked it) Follow the steps below and you should be okay. Note: I … Read more

How to create custom helper functions in Laravel 5

Creating simple PHP helper functions in Laravel 5 is not really something that comes out of the box, unlike what is obtained in CodeIgniter. This is one of the very few things I initially missed when I switched from CodeIgniter to Laravel. However, there is a short solution. This might not necessarily be in compliance … Read more