Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As fideloper mentioned is his article, extending the <code>Request</code> class goes a little bit differently than it goes with normal classes. Simpler, though:</p> <p><strong>1.</strong> Create your extended <code>Request</code> class and make sure it can be autoloaded;</p> <p><strong>ExtendedRequest.php</strong></p> <pre><code>namespace Raphael\Extensions; use Illuminate\Support\Facades\Response as IlluminateResponse; class Response extends IlluminateResponse { public function isSecure() { return true; } } </code></pre> <p>Note that we extended the <code>isSecure</code> method, instead of <code>secure</code>. This is because <code>secure</code> simply calls <code>isScure</code>, from Symfony's base <code>Request</code> class.</p> <p><strong>2.</strong> Make sure Laravel uses your extended class. To do so, alter your <strong>start.php</strong> file;</p> <p><strong>bootstrap/start.php</strong></p> <pre><code>/* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ use Illuminate\Foundation\Application; Application::requestClass('Raphael\Extensions\Request'); $app = new Application; $app-&gt;redirectIfTrailingSlash(); </code></pre> <p><strong>3.</strong> Make sure you have the right alias set in your <strong>app.php</strong> config file.</p> <p><strong>app/config/app.php</strong></p> <pre><code>'aliases' =&gt; array( // ... 'Request' =&gt; 'Raphael\Extensions\Request', // ... ), </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload