User Authentication in Laravel 4.x: Simple Guide Part 2

Part 1: User Authentication in Laravel 4.x: Simple Guide Part 1

user authentication in laravel 4 part 2

User Authentication In Laravel Screenshot

Let’s see what we have covered so far in the first part of this tutorial:

  • Database Creation And Configuration
  • Migrations
  • Seeding
  • Controllers

Now we are left with Routing and Views, let’s start with routes first.

Defining Routes

Since we are using restful controllers in our application, we will be using Route::controller() method for registering routes. Route::controller() allows us to define all the routes to a restful controller’s actions using a single call per controller. Read more…


User Authentication in Laravel 4.x: Simple Guide Part 1

user authentication in laravel 4 part 1

User Authentication In Laravel 4 Tutorial

In my previous article regarding Laravel migrations, I have mentioned that Laravel has a nice Authentication component. Today, we will see how we can use Laravel’s Auth component to build a simple user authentication in Laravel 4. So, let’s get started. Read more…


ZURB Foundation 5: Creating A Responsive Blog Layout

ZURB Foundation 5 Tutorial

ZURB Foundation 5

ZURB’s Foundation is a light weight framework for designing responsive web applications, it comes packed with: CSS3 media queries, The Grid, reusable HTML5 components and several jQuery plugins to aid interactivity. Furthermore, Foundation is built with mobile-first approach and allows the stacking of content by default using predefined break points. Or, in other words, we can say that it is responsive by default. Read more…


Database Migrations In Laravel 4

Laravel 4 developed by Taylor Otwell, is indeed a great php framework out there. It is suitable for both small and large scale applications, and has a very active community of really helpful people. I started using laravel more or less four months ago, and I have not searched google for “the best php framework” since then. With its powerful components like: a powerful and flexible routing system, an expressive query builder Fluent, Eloquent ORM, a descent authentication component, an intelligent IoC Container, Blade template engine and Artisan CLI tool, it just rocks (pardon me if I am missing something here).

Database Migrations In Laravel

Database migrations in Laravel provide you with an easy way of managing your application’s database schema. When using migrations, a lot of tasks related to database schema become a lot easier; by using migrations you can change the structure of database tables on the fly Read more…


Managing Dependencies Using Inversion Of Control in PHP: Step By Step

In my previous article, I have explained DI (Dependency Injection). In this article, I will explain how we can use Inversion of Control in PHP to reduce complexity that comes with DI.

Every design pattern has its positive and negative aspects, DI can make it easier to automate the testing process using unit testing frameworks. But, on the other side, DI can introduce extra complexity in your code that makes it more verbose and less readable. For example:

<?php

$subdep = new SubDep();     //dependency required for Dep1 class.
$dep1 = new Dep1($subdep);  //creating Dep1 by injecting its dependency
$dep2 = new Dep2();         //creating Dep2.
$dep3 = new Dep3();         //creating Dep3
$instance = new SomeClass($dep1,$dep2,$dep3); // injecting required dependencies

As you can see, SomeClass requires three dependencies, whereas Dep1 has its own dependency (more complexity). So the point is, if you are dealing with lot of dependencies in your application, you could end up writing and repeating a lot of code throughout your application. To subdue this problem, we use another design pattern called as Inversion of Control Container.

In software engineering, inversion of control (IoC) is a programming technique, expressed here in terms of object-oriented programming, in which object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis.
wikipedia

Inversion Of Control in PHP: Dependency Management

What I have learned so far is, the more you try to explain inversion of control, the more it gets complicated. So, instead of digging in further details, its better to work through an example. Read more…