All articles in laravel 5: learn easy

Laravel 5 : learn Easy

A letter on Laravel from Vietnam

Beginning Laravel
Beginning Laravel

I’d like to share a letter which I’ve got few days back and I think, it’s really inspiring for any author.
The letter came from Vietnam and the reader wrote it after reading my book “Beginning Laravel” by Apress.
Continue reading A letter on Laravel from Vietnam

Adapter Pattern in PHP

Can we Adapt SMS into MAIL?
Now we’re going to do an impossible task.
Are you prepared?
Can we start?
This chapter is about the adapter pattern. It’s one of the design patterns that you’re currently on. Let us start with a real world example.
You know that internet connection is absolutely necessary for sending emails. Is it true in the real world? You’d say, well, I know that. An internet networking is a must.

Continue reading Adapter Pattern in PHP

Chain of responsibility in php

Let us see how Responsibility can be Unchained!
In object-oriented design, the chain-of-responsibility pattern belongs to behavioral design patterns segment. The simplest example contains a person using ATM. He’s entering pin, receiving payment and receipts etcetera.
What is behavioral design pattern? They are a type of design patterns that generally identify communicating objects.
You may ask, what kind of objects we’re talking about? These objects have common communication patterns between them. While communicating they must realize that patterns.

Continue reading Chain of responsibility in php

Decorator Patterns in PHP

When we want to add additional features to our existing classes we generally use decorator pattern.
Do you find this definition useful?
I believe the answer will be NO.
It says about only adding new features. It doesn’t say about how you will use that. Will you add the features by simply hard coding or you’ll add them in the run time.
That’s a pretty big difference.
Why?
Let us consider a simple example where we are talking about a hosting company. A typical hosting company sells hosting services and sometimes they also provide template designing.
Let’s design a pretty basic scenario.

Continue reading Decorator Patterns in PHP

Environment in Laravel 5.3

Laravel comes with many stunning features. One of them is definitely database migrations. In the next chapter we’ll discuss about migration in detail.
Before that we need to understand our environment properly. What is environment in Laravel? If you look at the document root you will find an ‘.env’ file. It basically says about the database connections. Where would we get that default database set up file? In the ‘config’ folder, we have a ‘database.php’ file. Open it up and see the content.

Continue reading Environment in Laravel 5.3

Routing in Laravel 5.3

Routing, a Static Method

laravel5-2-basic
laravel5-2-basic

Routing is the concept of setting up a new URI like http://localhost:8000/hello. It will take you to a destination web page. Laravel makes it extremely simple. It’s a static method that accepts two things: an URI and an anonymous function or Closure.
In the ‘app/Http/routes.php’ it’s been defined primarily. Start your favorite text editor and open the file. What you see?
You see some code like this:

Route::get('/', function () {
return view('welcome');
});

Continue reading Routing in Laravel 5.3

Composer-revolution and library of codes

Composer is a dependency management tool in PHP. For any PHP project you need to use your library of codes. Composer easily manages that task on your behalf helping you to declare those codes. You can also install or update any code in your library through composer. Please visit https://getcomposer.org for more details.
In the opening page of https://getcomposer.org, click the ‘getting started’ link.

composer home page
composer home page

In the above page you find two links – ‘locally’ and ‘globally’. It stands for two options. Suppose you don’t want to run composer globally or centrally in your system. In that case, you have to download and install composer each time for every project. But the global option is always preferable because once composer is installed in your system bin folder you can call it any time for any project.

Continue reading Composer-revolution and library of codes

Learn Laravel 5.2.45

laravel5-2-basic
laravel5-2-basic

Chapter 1. Composer

Composer is a dependency management tool in PHP. For any PHP project you need to use your library of codes. Composer easily manages that task on your behalf helping you to declare those codes. You can also install or update any code in your library through composer. Please visit https://getcomposer.org for more details.
In the opening page of https://getcomposer.org, click the ‘getting started’ link.

Composer Home Page
Composer Home Page

In the above page you find two links – ‘locally’ and ‘globally’. It stands for two options. Suppose you don’t want to run composer globally or centrally in your system. In that case, you have to download and install composer each time for every project. But the global option is always preferable because once composer is installed in your system bin folder you can call it anytime for any project.

Continue reading Learn Laravel 5.2.45