title: Get onlyTrashed() does not exist in query builder
body: <p>I am trying to get trashed rows from table messages:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>public function trash() {
      return $this-&gt;onlyTrashed()
          -&gt;where('user_id', '=', $this-&gt;_u)
          -&gt;orWhere('receiver', '=', $this-&gt;_u)
          -&gt;orderBy('deleted_at', 'desc')-&gt;get();
  }
  </code></pre>
  
  <p>I get this error: </p>
  
  <pre class="lang-php prettyprint-override"><code>Method Illuminate\Database\Query\Builder::onlyTrashed does not exist.
  </code></pre>
  
  <p>I checked up Builder and SoftDeletes files for onlyTrashed method and it does not exist, how can I look up to trashed messages from message table?</p>
  
  <p>The only way I think about is to create method that doesn't return messages where delete_at is not null and for trashed to return only those where it is not null. But I am still wondering why this doesn't work since it is in documentation at this url:</p>
  
  <p><a href="https://laravel.com/docs/5.6/eloquent#soft-deleting" rel="noreferrer">https://laravel.com/docs/5.6/eloquent#soft-deleting</a></p>
  
  <p><strong>MORE INFO</strong></p>
  
  <p>Yes it is inside model and yes I added use SoftDeletes: </p>
  
  <p><code>use Illuminate\Database\Eloquent\SoftDeletes;</code> - on top </p>
  
  <p><code>use SoftDeletes;</code> after opening the class</p>
  
  <p>Let me paste entire model here:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  use Illuminate\Support\Facades\DB;
  
  class Messages extends Model
  {
  
  use SoftDeletes;
  
  protected $fillable = [
      'user_id', 'subject', 'text', 'receiver'
  ];
  
  public $_u;
  
  protected $dates = ['deleted_at'];
  
  public function __construct() {
      $this-&gt;_u = auth()-&gt;user()-&gt;user_id; //or some id as string
  }
  
  public function trash() {
          return $this-&gt;onlyTrashed()
          -&gt;where('user_id', '=', $this-&gt;_u)
          -&gt;orWhere('receiver', '=', $this-&gt;_u)
          -&gt;orderBy('deleted_at', 'desc')-&gt;get();
  }
  
  public static function trashed() {
          return self::onlyTrashed();
  }
  }
  </code></pre>
  
  <p>And controller has:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function __construct() {
          $this-&gt;middleware('auth');
      }
  
  public function index($field = 'trash') {
      if ($field !== "new") {
          $messages = (new Msg)-&gt;$field();
          $user = auth()-&gt;user();
          return view('pages.messages', compact('messages', 'user'));
      }
      return view('pages.messages.new', compact('messages', 'user'));
  }
  </code></pre>
  
  <p>I tried calling static as well and I tried doing it from <strong>tinker</strong> and still keep getting:</p>
  
  <p>onlyTrashed() doesn not exist</p>