public function findBy($field, $value)
    {
        $model_class = $this->getModelName();
        return $model_class::where($field, $value)->first();
    }
public function findBy($field, $value)
    {
        $model_class = $this->getModelName();
        return $model_class::where($field, $value)->first();
    }
public function findBy ( $ field , $ value ) { $ model_class = $ this -> getModelName ( ) ; return $ model_class :: where ( $ field , $ value ) -> first ( ) ; }
Find a record by a custom field

@method findBy
@param  string $field   The field to search by
@param  mixed $value    The field value
@return Model | null
Find a record by a custom field