title: Slim Application Error: Respect\Validation\Validator
body: <p>I get this error when trying to Validate my OrderForm.php. If someone followed <a href="http://codecourse.com" rel="nofollow noreferrer">Codecourse Shopping Cart Tutorial</a> you may know why I get this error. Here is my code in some of my files that I think is most relevant to this error and of course the error. 
  </p>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>Message: Class 'Respect\Validation\Validator' not found<br>
    File: PATH/cart/app/Validation/Forms/OrderForm.php
    on 13</p>
  </blockquote>
  
  <hr>
  
  <p><strong>I will also post this image of my Directory Folders:
  <a href="https://i.stack.imgur.com/p9a0h.png" rel="nofollow noreferrer">Directory Folder Image</a></strong></p>
  
  <hr>
  
  <p>OrderForm.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace Cart\Validation\Forms;
  
  
  use Respect\Validation\Validator as v;
  
  class OrderForm
  {
      public static function rules()
      {
          return [
              'email' =&gt; v::email(),
              'name' =&gt; v::alpha(' '),
              'address1' =&gt; v::alnum(' -'),
              'address2' =&gt; v::optional(v::alnum(' -')),
              'city' =&gt; v::alnum(' '),
              'postal_code' =&gt; v::alnum(' '),
          ];
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Validator.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace Cart\Validation;
  
  use Cart\Validation\Contracts\ValidatorInterface;
  use Psr\Http\Message\ServerRequestInterface as Request;
  use Respect\Validation\Exceptions\NestedValidationException;
  
  class Validator implements ValidatorInterface
  {
      protected $errors = [];
  
      public function validate(Request $request, array $rules)
      {
          foreach ($rules as $field =&gt; $rule) {
              try {
                  $rule-&gt;setName(ucfirst($field))-&gt;assert($request-&gt;getParam($field));
              } catch (NestedValidationException $e) {
                  $this-&gt;errors[$field] = $e-&gt;getMessages();
              }
          }
  
          $_SESSION['errors'] = $this-&gt;errors;
  
          return $this;
      }
  
      public function fails()
      {
          return !empty($this-&gt;errors);
      }
  }
  </code></pre>
  
  <p>ValidatorInterface.php</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace Cart\Validation\Contracts;
  
  use Psr\Http\Message\ServerRequestInterface as Request;
  
  interface ValidatorInterface
  {
      public function validate(Request $request, array $rules);
      public function fails();
  
  }
  </code></pre>
  
  <p><strong>Edit:</strong> I just want to say that I changed:<br>
  <code>use Respect\Validation\Validator as v;</code> <br>
  to <br>
   <code>use Cart\Validation\Validator as v;</code></p>
  
  <p>And then I get a completely new error so that did that work.</p>