• About

Sanjib Sinha

~ On Computer Science, C, C++, PHP, C#, Java, Python, Dart and Ethical Hacking and more…

Sanjib Sinha

Category Archives: laravel 5.7

Interfaces and Method Injection in Laravel 5.8

18 Monday Mar 2019

Posted by Sanjib Sinha in Classes and Object, laravel 5.7, Laravel 5.8, PHP, php 7

≈ Leave a comment

Tags

Interfaces and Method Injection, laravel, Laravel 5.8

  • JAVA CODING BOOTCAMP: LEARN LANGUAGE BASICS AND ALGORITHM
    JAVA CODING BOOTCAMP: LEARN LANGUAGE BASICS AND ALGORITHM
  • discrete-mathematical-algorithm-data-structures
    discrete-mathematical-algorithm-data-structures
  • PHP 7 : Intensive Coding Bootcamp For One Month to Create a PHP Framework
    PHP 7 : Intensive Coding Bootcamp For One Month to Create a PHP Framework
  • PHP, Java, Dart And Discrete Methematical Algorithm Boks in one place
    PHP, Java, Dart And Discrete Methematical Algorithm Boks in one place
PHP, Java, Dart And Discrete Mathematical Algorithm Books in one place

https://leanpub.com/u/sanjibsinha

  • Laravel All Model Relations


Get my all books here….

https://leanpub.com/u/sanjibsinha

Laravel Authentication

Abstraction in OOP involves extraction of relevant details. Consider the role of a car salesman. There are many types of consumers. Everyone wants to buy a car, no doubt, but each one has differences in their criteria. Each of them is interested in one or two certain features. This attribute varies accordingly. Shape, color, engine power, power steering, price … the list is endless. The salesman knows all the details of the car but does he repeat the list one by one until someone finds his or her choice?
No.
He presents only the relevant information to the potential customer. As a result the salesman practices “Abstraction” and presents only relevant details to customer. Now consider abstraction from the perspective of a programmer who wants a user to add items to list.
Abstraction does not mean that information is unavailable but it assures that the relevant information is provided to the user. PHP 5 had introduced abstract classes and methods much before. And PHP 7 enhances it now making the general purpose language completely object oriented. Classes defined as abstract may not be instantiated and any class that contains at least one abstract method must also be abstract.
Remember that abstract methods can not define the implementation. On the other hand, object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
Interfaces are defined with the interface keyword, in the same way as a standard class, but without any of the methods having their contents defined.
All methods declared in an interface must be public; this is the nature of an interface. In Laravel, you will find the injection of interfaces to the classes quite frequently. In Laravel Interface is considered as a Contract.
Contract between whom? And why? Because an interface does not contain any code but it only defines a set of methods that an object implements. In SOLID design principle we have talked about maintaining a library of small classes with clearly defined scopes, and it is achievable with the help of Interfaces.

Share this:

  • Facebook
  • WhatsApp
  • Twitter

Like this:

Like Loading...

How to install Composer globally

12 Wednesday Dec 2018

Posted by Sanjib Sinha in Laravel 5, laravel 5.7, MySQL, PHP, php 7, PHP Developers, Software

≈ Leave a comment

Tags

composer, dependency management, laravel, laravel 5.7, PHP

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 →

Share this:

  • Facebook
  • WhatsApp
  • Twitter

Like this:

Like Loading...

Why Resourceful Controller is Important for Authentication

10 Monday Dec 2018

Posted by Sanjib Sinha in Coding, laravel 5.7, laravel 5.7 all model relations explained, laravel 5: learn easy, PHP, php 7

≈ Leave a comment

Tags

authentication, authorization, laravel, laravel 5.7, Middleware, technology

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 →

Share this:

  • Facebook
  • WhatsApp
  • Twitter

Like this:

Like Loading...

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

30 Tuesday Oct 2018

Posted by Sanjib Sinha in Laravel 5, laravel 5.7, php 7, PHP Developers

≈ 1 Comment

Tags

laravel, laravel 5.7, laravel books, laravel training in kolkata, laravel tutorials

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…

Share this:

  • Facebook
  • WhatsApp
  • Twitter

Like this:

Like Loading...

Authentication in Laravel 5.7

24 Wednesday Oct 2018

Posted by Sanjib Sinha in Laravel 5, laravel 5.7, MySQL, PHP, php 7, PHP Developers

≈ Leave a comment

Tags

authentication, laravel 5.7, laravel 5.7.* tutorials

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.

Share this:

  • Facebook
  • WhatsApp
  • Twitter

Like this:

Like Loading...

Laravel 5.7 installation

07 Sunday Oct 2018

Posted by Sanjib Sinha in laravel 5.7, laravel 5: learn easy

≈ Leave a comment

Tags

laravel 5.7

Share this:

  • Facebook
  • WhatsApp
  • Twitter

Like this:

Like Loading...

I write regularly at ZeroDotOne

ZeroDotOne ZeroDotOne

ZeroDotOne – Learn Flutter, WordPress, SEO and How to Earn Online

ZeroDotOne

ZeroDotOne – Learn Flutter, WordPress, SEO and How to Earn Online

ZeroDotOne

Create a free website or blog at WordPress.com.

Cancel
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
%d bloggers like this: