protected function checkForDeleted(Builder $query)
    {
        if (request()->has('deleted') && request()->input('deleted') === '1')
            $query = $query->onlyTrashed();

        return $query;
    }
protected function checkForDeleted(Builder $query)
    {
        if (request()->has('deleted') && request()->input('deleted') === '1')
            $query = $query->onlyTrashed();

        return $query;
    }
protected function checkForDeleted ( Builder $ query ) { if ( request ( ) -> has ( 'deleted' ) && request ( ) -> input ( 'deleted' ) === '1' ) $ query = $ query -> onlyTrashed ( ) ; return $ query ; }
Check for deleted records option

@param Builder $query
@return mixed
Check for deleted records option