How to install Composer globally

Tags

, , , ,

First you need to issue this command:
ss@ss-desktop:~$ sudo apt-get update
You get this output:
[sudo] password for ss:
Hit:1 http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu xenial InRelease
Hit:2 http://ppa.launchpad.net/ricotz/unstable/ubuntu xenial InRelease
Hit:3 https://dl.winehq.org/wine-builds/ubuntu xenial InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Hit:5 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease
Get:6 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Hit:7 http://ppa.launchpad.net/wine/wine-builds/ubuntu xenial InRelease
Get:8 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Fetched 323 kB in 2s (130 kB/s)
Reading package lists... Done

Continue reading

Advertisements

Why Resourceful Controller is Important for Authentication

Tags

, , , , ,

Creating Controllers in Laravel is super simple. In an MVC pattern, controllers play a vital role and defining your all request handling logic as an anonymous function in route file is unthinkable for a big application.

So we always use controllers as a transport medium. The main advantage of a controller is it can group all the request handling into a single class and that class can be stored in the ‘app/HTTP/Controllers’ directory.

There are a few ways to create a controller and we can always add some functionalities into it later to use features such as Middleware.

You can create a basic controller by using this command:
$ php artisan make:controller MyController
However, for a big application such as what we are going to create, it is always wise to create a resourceful controller.

When you issue such command:
$ php artisan make:controller MyController –resource
Laravel creates a controller class that automatically adds typical “CRUD” routes to the controller. This single line of code generates all types of methods that we usually require to create, retrieve, update and delete records. Continue reading

Two Books Coincided

An Amazing day indeed. The last day. I self-published a book on Laravel’s Authentication services on Amazon and Leanpub, simultaneously. The book handles not only the Authentication part alone, it throws light on Middleware filtering and Authorizations also.

In the afternoon while checking my Email I found my Publisher Springer Nature and Apress published another book on Ethical Hacking with Kali Linux. It was due. It’s an early release.

You cannot ignore either of two offspring born at the same time from the same pregnancy. A cute bundle indeed!

Just published! My new book on “Laravel 5.7.*: Middleware, Authentication, Authorization Explained: How to Authenticate a company,projects and tasks management application”.

Just published! My new book on “Beginning Ethical Hacking with Kali Linux: Computational Techniques for Resolving Security Issues”.

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

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