类App \ Repositories不存在

I'm trying to use a Repository, but I'm getting this error:

Class App\Repositories\CategoryRepository does not exist

This is my CategoryRepository.php

<?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)->get();//united

                $categories=$this->addRelation($categories);

                return $categories;

            }

    }

    ?>

And this is my controller:

<?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->categoryRepository = $categoryRepository;
    }

    public function index(Request $request)
    {

        $subcate = new SubCate;

        try {

            $allSubCategories=$subcate->getCategories();

        } catch (Exception $e) {

            //no parent category found
        }

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

    }
}

What is wrong?

Your category repository class name is

class SubCate

but you are using

use App\Repositories\CategoryRepository; .

So, change your class name to CategoryRepository