Class App\Repositories does not exist
<p>I'm trying to use a Repository, but I'm getting this error:</p>

<pre><code>Class App\Repositories\CategoryRepository does not exist
</code></pre>

<p>This is my CategoryRepository.php</p>

<pre><code>&lt;?php

namespace App\Repositories;


    class SubCate
    {
        /**
         * Get all of the tasks for a given user.
         *
         * @param  User  $user
         * @return Collection
         */

            public function getCategories(){

                $categories=\App\category::where('parent_id',0)-&gt;get();//united

                $categories=$this-&gt;addRelation($categories);

                return $categories;

            }

    }

    ?&gt;
</code></pre>

<p>And this is my controller:</p>

<pre><code>&lt;?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use DB;
use App\Product;
use App\Category;

use App\Repositories\CategoryRepository;


class ProductController extends Controller
{
    //
    public function __construct(CategoryRepository $categoryRepository)
    {
        $this-&gt;categoryRepository = $categoryRepository;
    }

    public function index(Request $request)
    {

        $subcate = new SubCate;

        try {

            $allSubCategories=$subcate-&gt;getCategories();

        } catch (Exception $e) {

            //no parent category found
        }

        return view('welcome', [
            'allSubCategories' =&gt; $allSubCategories,
        ]);

    }
}
</code></pre>

<p>What is wrong?</p>