Blog

Laravel’s make method is used to create an instance of a class or interface.While creating an instance with make method Laravel will automatically inject all dependencies of class that is defined in it’s constructor. E.g. an instance of the Mailer class would be automatically injected in below code.

Here is Code for THE MAKE() METHOD DO IN LARAVEL

namespace App\Services;

use \Illuminate\Mail\Mailer;

class MyService
{
    public function __construct(Mailer $mailer) {
        $this->mailer = new Mailer;
    }
}

Also Read: Common Laravel Interview Questions answer

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.