Laravel Repository Pattern

repository pattern

The Repository Pattern can be very helpful to you in order to keep your code a little cleaner and more readable. In fact, you don’t have to be using Laravel in order to use this particular design pattern. For this episode however, we will use the object oriented php framework Laravel to show how using repositories will make our controllers a bit less verbose, more loosely coupled, and easier to read.…

Laravel File Structure

laravel-file-structure

When working on applications and websites, we usually follow some type of convention for organizing files and assets that support the site. You might be familiar with how Codeigniter, CakePHP, or your own home grown solutions work. The MVC architecture has been the de facto design standard for some time now. Of course MVC is our Model, View, Controller design pattern that separates Data, Presentation, and Routing apart to make things easier to control.…

Laravel Auth Tutorial

laravel auth tutorial

Most websites will need a way to allow users to log in so that they can access resources, update information, and so on. Some frameworks like Codeigniter do not have a built in authentication system. In a scenario like that, you would have to write your own, or implement a third party solution. With Laravel, user authentication is baked right in. Let’s take a look at how we can put Laravel Auth to use!…

Custom Helper Functions in Laravel

Custom Helper Functions in Laravel

In creating our PHP String Helper Functions, we were able to define four useful string helper functions to use in our projects. Recall we had a split_string() function, a find_between() function, a find_all() function, and a delete() function. They’re really cool and helpful for quick and dirty string manipulation. Let’s say we want to make use of these functions in Laravel, how can we do that?…

Laravel Validation

Laravel Validation

In our last episode when we worked with the Laravel Form Class, we were able to add some great functionality to our small RESTful blog application. We saw how the Laravel Form Class made it easy to bring forth forms with great power and efficiency. We also used the great Twitter Bootstrap Framework to spice up the looks just a little bit. There is something we need to add though to the forms we have created and that would be Validation.…