Posts

Showing posts from December, 2018

Restful API In Laravel 5.6 Using Jwt Authentication

Image
When I got a Laravel API kind of assignment first time, I am like stunned. Hmm !!! Well, every new bee will be the same. Hope this will give some idea for the beginners. Before jumping, Am assuming that you have basic knowledge in 1.            Laravel 2.            Laravel middleware concepts. Yea, That's it!! Go Ahead ... Overview This article is mainly dealing with how to build restful API in laravel using JWT(JSON  Web Token). It is very easy and simple implementation in laravel. when you work with large application and you also want to make a mobile or android application for this project. you should write API layer or API for your application which helps to communicate with your android app and your live server. Steps to implement Step 1: Google it !!! Yea, Simply google “Laravel API Jwt Authentication”.  Step 2: Ins...

Dependency Injection in PHP

What is Dependency Injection?             Dependency Injection is a software design pattern that helps you to avoid hard-coding dependencies and makes it possible to change the dependencies at runtime and compile time. The following example with 2 classes named Employee, Company will help you to understand what is dependency injection. Let us consider the following example. Normally we are following this type of coding. <?php class   Employee {             private $firstName ;             private $lastName ;             public function __construct ( $firstName , $lastName ) {                         $this -> first...