I am trying to create a namespace in Laravel 4, I have read several tutorials here and in a vibrant book of code. But I still can't figure it out. My application is configured as follows:
application / controllers / itemController application / services / itemValidator
in my json linker file (which I dump autostart in evertime changes it) I have:
"autoload": { "classmap": [ <usual data...> "app/repositories", "app/services", ], "psr-0": { "Services": "app/services/" }
my element controller is configured as:
<?php use Services\ItemValidator; class ItemsController extends BaseController { public function store() { $validator = new ItemValidator; .....etc.....
and my ItemsValidator class is configured as:
<?php namespace Services; class ItemValidator extends BaseValidator { ....code....
Which gives me the following error when it hits the line $validator = new ItemValidator :
Class 'Services\ItemValidator' not found
source share