Are you importing that class correctly? Categories is probably in some namespace, if it was a model it would be something like App\Categories (please don't use plural form for models, it's a model, not a collection).
You have to include the namespace too when you store the class name in a variable.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community