Eloquent Accessors & Mutators OR Custom Attributes

The accessor and mutator both are the public functions of Laravel model for getting and setting model's attributes.

An accessor will automatically be called by Eloquent when attempting to retrieve the value of the first_name attribute:

$fullName = $user->full_name;

It's f [...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 1 year ago

Authentication System

Middleware: Only allow authenticated users to access a given route. For protecting/restricting routes, we need to use Middleware.

Middleware Steps:

1. Creating

2. Registering

3. Uses

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 1 year ago

How to Register & Use Service Providers

Introduction:

Go ahead and look at the contents of the config/app.php file. You'll find an array entry that lists all the service providers that will be loaded during the bootstrapping of the Laravel application (with core aplication). If we want to load [...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 1 year ago