Using $this when not in object context in a Laravel controller
<p>I created a public static function in a controller and I need to access a class property which is set on the constructor. I normally use <code>$this-&gt;something</code> to access such class properties, but this time, I got this error:  </p>

<blockquote>
  <p>Using <code>$this</code> when not in object context</p>
</blockquote>

<p>Here's the code:  </p>

<pre><code>public static function PayExecute() {
    $paymentId = Input::get('paymentId');
    $PayerID = Input::get('PayerID');

    $cont = $this-&gt;apiContext;
}
</code></pre>