Question: I have users model in laravel

```
public static function searchScoop($keyword)        
{
    $users = User::where('username','like','%'.$keyword.'%')->

    orwhere('email','like','%'.$keyword.'%')->

    orwhere('phone','like','%'.$keyword.'%')->

    with('user_permission','user_division')->

    get(['id','username','email','phone','division','permission']);

    return $users;
}   

```

now how can i get trashed results with users variable 
i tried to to put withTrashed -> before where after get everywhere but noting works ..

thank you

Answer: 
Please try with `withTrashed()` which will give also the soft deleted records. If you only want soft deleted records use `onlyTrashed()`

```
 public static function searchScoop($keyword)
    {
        $users = User::withTrashed()
        ->where('username','like','%'.$keyword.'%')
        ->orwhere('email','like','%'.$keyword.'%')
        ->orwhere('phone','like','%'.$keyword.'%')
        ->with('user_permission','user_division')
        ->get(['id','username','email','phone','division','permission']);
        return $users;
    }   

```
This is [correct syntax](https://laravel.com/docs/5.3/eloquent#querying-soft-deleted-models):

```
public static function searchScoop($keyword)
{
    return User::withTrashed()
        ->where('username', 'like' ,'%'.$keyword.'%')->
        ->orwhere('email', 'like' ,'%'.$keyword.'%')->
        ->orwhere('phone', 'like' ,'%'.$keyword.'%')->
        ->with('user_permission', 'user_division')->
        ->get(['id', 'username', 'email', 'phone', 'division', 'permission']);
}

```