public function has($fileableId, File $file) { return $file->getConnection()->table($file->getFileableTable())->where('fileId', $file->getKey())->where('fileableId', $fileableId)->first() === null ? false : true; }