public static function countMergableDocuments() { return Document::whereHas('object', function ($query) { $query->where('work_pid', '<>', ''); })->with('object')->count(); }
public function __construct() { $this->baseQuery = Document::whereHas('object', function ($query) { $query->where('work_pid', '<>', ''); })->with('object'); }