title: Use Laravel 4 Encrypter within a namespace
body: <p>I am trying to <code>use Illuminate\Encryption\Encrypter;</code> within a namespace which I created. The code really exists in my file.</p>
  
  <p><strong>Problem:</strong>
  I want laravel to use the key set under 'app/config/app.php' automaticly. However the constructer wants me to set it properly with my hands.</p>
  
  <p>To see how this task is handled by Taylor Otwell, I searched for an example and saw that under "Illuminate\Cache\DatabaseStore", it was set to <code>$encrypter</code> as an instance, using constructer. Tylor also uses a function to <code>getEncrypter();</code> as follows:</p>
  
  <pre><code>/**
   * Get the encrypter instance.
   *
   * @return \Illuminate\Encryption\Encrypter
   */
  public function getEncrypter()
  {
      return $this-&gt;encrypter;
  }
  </code></pre>
  
  <p>Because I want my class to be automaticly loaded with a function in another class; I can't use IoC Container.</p>
  
  <p>Here are my functions and params:</p>
  
  <pre><code>/**
   * The encrypter to be used for several reasons.
   */
  protected $encrypter = "Illuminate\Encryption\Encrypter";
  
  /**
  * Returns the encrypter.
  * 
  * @return Object
  */
  public function getEncrypter()
  {
      return $this-&gt;createEncrypter();
  }
  
  /**
   * Creates a new encrypter object.
   *
   * @param  $string  $encrypter
   * @return Obj $encrypter instance
   */
  public function createEncrypter()
  {
      $class = '\\'.ltrim($this-&gt;encrypter, '\\');
  
      return new $class;
  }
  
  /**
   * Sets the crypter used by MyFacadeName
   * 
   * @param  Encrypter  $encrypter
   */
  public function setEncrypter($encrypter)
  {
      $this-&gt;encrypter = $encrypter;
  }
  </code></pre>
  
  <p>What is the difference makes the parser think that Taylor is right and I am wrong? What am I missing?</p>