title: trying to use a trait but keeps saying not found
body: <p>I have a api trait that connects to an external endpoint. I want to use this trait in a class called ProductClass. The trait is in the same folder as the class, but I get a error is I add use ApiTrait in the class. Error says it cannot find the trait, So if I include the trait file at the top of the class file, I get this error, cannot find ApiTrait in 
  ProductClass\ApiTrait.
  If i pass the trait into the constructor I get an error from my index page when I call the ProductClass because I am not passing in the trait. I dont want to pass any params to the constructor just the string top append to the .env endpoint. any clues greatly appreciated
  heres my ApiTrait code</p>
  
  <pre><code>&lt;?php
  namespace ApiTrait;
  
  require './vendor/autoload.php';
  use GuzzleHttp\Client;
  
  trait ApiTrait
  {
      protected $url;
      protected $client;
  
    public function __construct()
    {
      $this-&gt;url =  getenv('API_URL');
      $this-&gt;client = new Client();
  
    }
  
    private function getResponse(String $uri = null)
    {
      $full_path = $this-&gt;url;
      $full_path .=$uri;
      try {
          $response = $this-&gt;client-&gt;get($full_path);    
      }
      catch (GuzzleHttp\Exception\ClientException $e) {
          $response = $e-&gt;getResponse();
      }
      return json_decode($response-&gt;getBody()-&gt;getContents(), true);
  
    }
    public function getAPIData($uri)
    {
      return $this-&gt;getResponse($uri);
    }
  }
  </code></pre>
  
  <p>this is my ProductClass code</p>
  
  <pre><code>&lt;?php
  
  namespace ProductClass;
  include_once("ApiTrait.php");
  
  use DataInterface\DataInterface;
  
  class Product implements DataInterface
  { 
      use ApiTrait\ApiTrait
      private $api;
  
      public function __construct(ApiTrait\ApiTrait $apiTrait) {
         $this-&gt;api = $apiTrait;
      }
  
      private function getResponse($append, $try) {
          $urlAppend = $append; 
          $good_data = false;
  
          do{
            try{
              $result = $this-&gt;api-&gt;getAPIData($urlAppend);
              //check data to see if valid
              if(!array_key_exists( "error",$result)){
                  $good_data = true;
                  return $result;
              }
            }
            catch(Exception $e){
              //call api upto 10 times
              if($try &lt; 10) {
                  sleep(1);
                  getData($append, $try++);
              } else { //return a connection  error
                  $api_error['error']='unable to connect to api';
                  return  $api_error;
              }
          }
        } while($good_data === false);
    }
  
    public function getData($append, $try = 0)
    {
       return $this-&gt;getResponse($append, $try);
    }
  
  }
  </code></pre>