title: laravel eloquent resources api send status code
body: <p>In Laravel 5.5 We can set API through resources (<a href="https://laracasts.com/series/whats-new-in-laravel-5-5/episodes/20" rel="noreferrer">https://laracasts.com/series/whats-new-in-laravel-5-5/episodes/20</a>), but how can we send STATUS CODE?</p>
  
  <p>Also how should I set status dynamically which is defined in with()</p>
  
  <pre><code>//namespace App\Http\Resources;
  
  //use Illuminate\Http\Resources\Json\Resource;
  
  //class User extends Resource 
  
  public function with($request)
  {
      return [
          'status' =&gt; 'success',
      ];
  }
  </code></pre>