Answers for "Dependency Injection & Controllers"

0

Dependency Injection & Controllers

<?php

namespace App\Http\Controllers;

use App\Repositories\UserRepository;

class UserController extends Controller
{
    /**
     * The user repository instance.
     */
    protected $users;

    /**
     * Create a new controller instance.
     *
     * @param  \App\Repositories\UserRepository  $users
     * @return void
     */
    public function __construct(UserRepository $users)
    {
        $this->users = $users;
    }
}
Posted by: Guest on August-22-2021

Code answers related to "Dependency Injection & Controllers"

Browse Popular Code Answers by Language