title: Using RedirecResponse outside Laravel
body: <p>I'm connecting my external App to do some actions into Laravel 5, get the response and continue. One of this actions is a login usign Laravel code:</p>
  
  <h1>Outside Laravel</h1>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  use Laravel\Laravel;
  
  # Some code here but not headers or html output
  Laravel::login();
  
  # Another some code more and then print login form from laravel blade template
  echo Laravel::loginView();
  </code></pre>
  
  <h1>Laravel custom connection class (outside Laravel)</h1>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  namespace Laravel;
  
  use App;
  use Illuminate;
  
  class Laravel
  {
      private static $app;
  
      private static function load()
      {
          require_once self::getPath('bootstrap/autoload.php');
  
          self::$app = require_once self::getPath('bootstrap/app.php');
  
          self::$app-&gt;make('Illuminate\\Contracts\\Http\\Kernel')-&gt;handle(Illuminate\Http\Request::capture());
      }
  
      public static function login()
      {
          self::load();
  
          $response = App::make('App\\Http\\Controllers\\User')-&gt;login($_POST);
  
          if ($response instanceof RedirectResponse) {
              # Here I want to stop my app, save cookies/headers from Laravel Login
              # and redirect to $response target url location
              # If I do it with a simple Location redirect, I lost cookies and headers
              # and User will be not authenticated on next request
              die($response);
          }
      }
  
      public static function loginView()
      {
          self::load();
  
          return view('pages.users.login');
      }
  }
  </code></pre>
  
  <h1>Laravel App\Http\Controllers\User@login</h1>
  
  <pre class="lang-php prettyprint-override"><code>class User
  {
      public function login($data)
      {
          $success = Auth::attempt([
              'user' =&gt; $data['user'],
              'password' =&gt; $data['password'],
          ], $data['remember']);
  
          if ($success) {
              return redirect()-&gt;to(url('/'));
          }
      }
  }
  </code></pre>
  
  <p>I have all code working (view templates, user validation, login) but I need at end redirect the login response with headers and cookies to be available on next request.</p>
  
  <p>There are a simple and clean way to do it? (There are more code, but it simplified here)</p>
  
  <p>Thanks a lot :)</p>