vendredi 24 février 2017

ReflectionException Class Not Found on Laravel Repository

I'm getting a reflection exception thrown on a repository. I simply cannot find the solution or why the exception is being thrown. I have quadruple checked the spelling, quadruple checked the case and quadruple checked the namespacing. The error I get is the following:

ReflectionException in Container.php line 731: Class App\Repositories\ProductRepository does not exist

The controller ProductController.php looks like this:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Repositories\ProductRepository;

class ProductsController extends Controller
{


protected $product;

public function __construct(ProductRepository $product){

    $this->product = $product;

}

//Other Methods...
}

The repository ProductRepository.php is in:

App\Repositories

and looks like this:

<?php

namespace App\Repositories;

class ProductRepository {

public function getProducts(){
//Some Query
}

}

I've scoured every Laravel forum and Stack for the answer but none of the solutions have worked. I've been hours trying to find a solution and I simply cannot fathom how the class is not being recognised. Any ideas what I could be missing here?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lSJuVw
via IFTTT

Aucun commentaire:

Enregistrer un commentaire