/** * Check if this object is a duplicate of another by finding the md5 hash. * Returns the first matching object or null. * @return Media|null */ public function isDuplicate() { return Media::where('etag', $this->etag)->where('id', '!=', $this->id)->get()->first(); }