I am struggling to set up a working name space in Laravel 4, I've read some guides on here and in the code bright book. But I still can't seem to figure it out. My app is set up as follows:
app/controllers/itemController app/services/itemValidator
in my composer json file (which I dump-autoload evertime it gets changed) I have:
"autoload": {
"classmap": [
<usual data...>
"app/repositories",
"app/services",
],
"psr-0": {
"Services": "app/services/"
}
my items controller is set up as:
<?php
use Services\ItemValidator;
class ItemsController extends BaseController {
public function store()
{
$validator = new ItemValidator;
.....etc.....
and my ItemsValidator class is set up as:
<?php namespace Services;
class ItemValidator extends BaseValidator
{
....code....
Which gives me the following error when it gets to the $validator = new ItemValidator
line:
Class 'Services\ItemValidator' not found