Uploading images on AWS S3 from a Laravel application

Any web application which deals with a lot of images or a lot of file downloads will for sure want to offload their space requirements for images and files from the mail server to buckets like what Amazon provides us. Some may even choose Amazon cloudfront (CDN) for storing images if their traffic is from different geo locations. So, in this tutorial I will show how we can use the Amazon SDK and the Laravel wrapper to store images on Amazon S3 inside a bucket.

Setting up services in Drupal and then view authenticated content using Drupal’s authentication

A mobile application communicating with a web service is very common now a days. And Drupal being one of the most popular CMS, it’s a common requirement for developers to communicate with Drupal CMS specially authenticated content.
In this tutorial, I will be demonstrating how to setup a basic Drupal service and access nodes which are only accessible to authenticated user.


Grunt JS – The awesome work flow with automatic JS, CSS minify and LESS compile

Every website – a public facing website or an application now a days uses a lot of Java script code. This means we have a lot of .js files included in our mark-up. And when ever we are working on optimisation of a site; the very first thing that we do is check the unnecessary assets that we are loading and if there is a way to reduce the size of those assets. In this tutorial, I will show you how grunt js can be used to compress and then concatenate JS and CSS files. And also we will see how we can compile an LESS files in to a CSS file.

Laravel 4 how to use events

One of the most powerful aspect of Drupal is the concept of hooks. We can modify core features of Drupal entities without hacking the core. It's a great way to separate the concerns of code which in long term helps us write maintainable code. Laravel 4 events is one such thing which I can compare with hooks. In this tutorial, I will show you how to use a Laravel event like user login and perform some activity using a completely difference class.


Working with Laravel DB seed and why not Migrations for data insert

From the very first time I started with Laravel's migration, I was using it to insert default data into the applications. The fact that running migrations will give me the default data is awesome. But with time, there were challenges and that's when I came to know why DB Seeding was also added in Laravel and why Seeding is the right way. In this tutorial, I will show you how and also tell you why.


Creating CSV output from database query result in Laravel 4

Generating a CSV file from some records in the database is a very common requirement which a web developer must come across. It will be nice and handy to have a generic function which will take some basic parameters and generate this for us. In this tutorial I will show how we can write a function inside a common utility class which will take a necessary parameters and generate a CSV file output.


Working with workbench and building packages in Laravel 4

I come from the world of Drupal where every code that we write is part of a module. This is very useful because over time I am able to develop modules which I can re-use in all of my projects. Codeigniter has this feature using HMVC which I showed in the tutorial HMVS architecture with Codeigniter. The same approach can be followed in Laravel 4 using workbench to create packages. This way we can make independent piece of code (or some dependent on other modules) and once we plug it in, the module is ready to do what it is supposed to do. In this tutorial I will start with a blog module which will be independent; it will have its own migrations, controllers, models, views and its own routes.


Laravel 4 Swift Mailer with dynamic config instead of mail.php to send mail through Gmail

Laravel 4 comes with the Swift Mailer library which works great in sending emails from your application. Just set the mail.php configuration file with the required variables and you are good to send emails. Inline images, attachment are like one line code. But the problem with a config file is that the parameters are fixed. I had a requirement where user would send email using their Gmail username and password. So, in this tutorial I will show you how to create a Swift Mailer instance and send a mail with a dynamic username, password and other parameters.


Laravel 4 forms, retain data, default and custom validations

Working with forms in Laravel 4 is real fun and there is hardly any PHP application which doesn’t have a form. So, in this tutorial I will demonstrate how to create a simple registration form using the Laravel’s form library. Then we will validate the data when the form is submitted. We will use the validation library which comes with Laravel 4 out of the box and also our custom validation rule.