Reflection API, Dependency Injection in PHP 7

Tags

, , ,

Beginning Ethical Hacking with Kali Linux

Beginning Ethical Hacking with Kali Linux

https://www.apress.com/in/book/9781484238905

In this video tutorial, I have shown how Reflection API works in PHP 7. Since many PHP frameworks such as Laravel 5.7 uses this Reflection API and Dependency Injection concepts, I think, understanding this major concept is essential for your PHP training.

Laravel 5.7.*: Middleware, Authentication, and Authorization Explained

Tags

, , , ,

Laravel 5.7.*: Middleware, Authentication, Authorization Explained: How to Authenticate a company, projects and tasks management application

Laravel 5.7.*: Middleware, Authentication, Authorization Explained: How to Authenticate a company, projects and tasks management application

https://www.amazon.com/gp/product/B07L2QFBRY/ref=dbs_a_def_rwt_bibl_vppi_i12

Hi, I have just published “Laravel 5.7.*: Middleware, Authentication, and Authorization Explained”. This book is 60% complete and I am currently working on it. Download your free copy and give valuable feedback.

https://leanpub.com/laravel57howtobuildacompanyprojectsandtasksmanagementapplication/embed

Get your copy here…

Authentication in Laravel 5.7

Tags

, ,

Laravel 5.7.*: Middleware, Authentication, Authorization Explained: How to Authenticate a company, projects and tasks management application

Laravel 5.7.*: Middleware, Authentication, Authorization Explained: How to Authenticate a company, projects and tasks management application

https://www.amazon.com/gp/product/B07L2QFBRY/ref=dbs_a_def_rwt_bibl_vppi_i12

This is the final part of our authentication section in the web programming series. Here we will learn how Laravel 5.7 manages authentication in a simple way and makes it user friendly, so that, you don’t have to write tons of lines of code and build your own library.

Why Laravel 5.7.* Model Relations are important to understand

Tags

, , ,

laravel5-7allmodelsrelationsexplained

Laravel 5.7.* All Model Relations Explained

Any awesome Laravel application greatly depends on Model relations. How they work, what are the magical methods behind them? Explained lucidly with examples.

You will learn all Model relations and how you can use them to build a complicated web application.

Apparently, this contents management application does not look very complicated, however, the relations are quite tangled and we will try to understand these relations through Laravel’s Model relations and Eloquent ORM; at the end, we will also learn how resourceful controllers play vital roles in such model relations.

How an article is related to a particular user and how from the article table we can fetch the data of that particular user or writer? An article uses many tags, but how we can access those tags from that article itself? An article may have many comments. Who has written those comments? Of course users. And these users have their own profiles which tell us about them, including name, email, city, and a short biography. Each profile page may have multiple comments written by other users about that profile-holder user. So we have comments table for both – articles and profiles. Can we use one single comment table to serve them both? Yes, we can do! A polymorphic relationship allows us to do that.

These questions are all very tricky, however, laravel model relations, Eloquent ORM, and resourceful controllers has solved these problems quite easily. As we progress we will learn one-to-one, one-to-many, many-to-many, has-many-through, and polymorphic relationships with concrete examples. By the way, we will also learn some major tricks of Laravel (like resource controller and views) that makes your development experience more pleasant.

Finally, what we will see in this application? A user have many articles. When you open the application, you will find the series of article titles. Each title will show who is the writer of it. If you click on each title, you can read the full article. If you click on the user name, you will see the user’s profile and all the articles he/she has written. The same rule is applied for the tags. Each tag may belong to many articles. Again any article may belong to many tags. So each article shows many tags. In the user profile we will see which tags he/she has used often and so on. In addition to that, we have comments on both pages, with a link to the users who have written them.

All together, it’s an interconnected contents management application that handles many complex queries effortlessly.

Laravel 5.7.* All Model Relations Explained

Tags

, ,

laravel5-7allmodelsrelationsexplained

Laravel 5.7.* All Model Relations Explained

Any awesome Laravel application greatly depends on Model relations. How they work, what are the magical methods behind them? Explained lucidly with examples.

You will learn all Model relations and how you can use them to build a complicated web application.

Here is the link for free download and read the book: Laravel 5.7 All Model Relations Explained

Laravel, Ubuntu and PHP 7.2

Tags

, , , , , ,

Sometimes this task seems daunting; you have Ubuntu 16 as your default OS and each time while installing Laravel 5.*.*, you are left with error messages reminding you that you don’t have many PHP extensions in your system; PHP extensions that support Laravel.
What you can do?
It’s a problem and must have a solution.
Here is the solution.
You need to make your system Laravel friendly. That is the first step when you have to purge old PHP from your system and install the latest ones.

Continue reading

Composer and Effective PHP Patterns

Tags

, , , ,

object oriented design patterns in php

object oriented design patterns in php


Object Oriented Design Patterns in PHP 7

Gang of Four!

How about starting this discussion by quoting from them?

Their famous book “Design Patterns, Elements of Reusable Object-Oriented Software”; and they are Erich Gamma, Richard Helm, Ralph Johnson and

John Vlissides.

The book starts with this meaningful statement— “Designing object-oriented software is hard, and designing reusable object-oriented software is even harder. You must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them.

Your design should be specific to the problem at hand but also general enough to address future problems and requirements. You also want to avoid redesign, or at least minimize it. Experienced object-oriented designers will tell you that a reusable and flexible design is difficult if not impossible to get “right” the first time. Before a design is finished, they usually try to reuse it several times, modifying it each time.

Yet experienced object-oriented designers do make good designs. Meanwhile, new designers are overwhelmed by the options available and tend to fall back on non-object-oriented techniques they’ve used before. It takes a long time for novices to learn what good object-oriented design is all about. Experienced designers evidently know something inexperienced ones don’t. What is it?”

This introductory paragraph ends with a question mark.
Continue reading

How Composer has Revolutionized the PHP World

If you plan to design object-oriented software, it is hard, and, designing reusable object-oriented software is even harder. How can a dependency management system like Composer make this task easier? Let us try to understand that in this chapter. We will see more usages of Composer, as we read in the next chapters.
Composer’s role in Effective Patterns

I would like to start this section by quoting from the famous book “Design Patterns, Elements of Reusable Object-Oriented Software” by the “Gang of Four” Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides.

Continue reading

Single Responsibility Principle in PHP

Tags

, , ,

“Single Responsibility Principle” or SRP is one of the most important concepts in object-oriented design. Whether you are a novice or an experienced designer, you must know and follow this principle if you want to make your objects loosely coupled; in software designing it is important to understand. Most often the inexperienced designers do not understand this core concept. And, it makes a real big difference in the time of making an application.
I have written a long article on the same topic in Medium