<commit_before><?php namespace Bishopm\Connexion\Repositories;

use Bishopm\Connexion\Repositories\EloquentBaseRepository;

class IndividualsRepository extends EloquentBaseRepository
{
	public function dropdown(){
    	return $this->model->orderBy('surname', 'ASC')->select('id','surname','firstname')->get();
  	}

  	public function findBySlug($slug)
    {
        return $this->model->with('sermons','blogs')->where('slug', $slug)->first();
    }

    public function getName($id)
    {
    	$indiv=$this->model->find($id);
    	return $indiv->firstname . " " . $indiv->surname;
    }

    public function forEmail($email)
    {
        $hhh=$this->model->with('household')->where('email', $email)->select('household_id')->first();
        if ($hhh){
            if ($hhh->household){
                $household=$hhh->household_id;
                return $this->model->where('household_id', $household)->select('id','surname','firstname')->get();   
            } else {
                return "No data";    
            }
        } else {
            return "No data";
        }
    }

    public function givingnumbers()
    {
        $giving=$this->model->where('giving','>',0)->select('giving')->orderBy('giving')->get();
        $pg=array();
        foreach ($giving as $give){
            $pg[]=$give->giving;
        }
        return $pg;
    }

    public function allchurchmembers()
    {
        return $this->model->with('household')->where('memberstatus', 'member')->whereNull('deleted_at')->select('id','surname','firstname','email','cellphone','household_id')->get();
    }

    public function everyone()
    {
        return $this->model->with('household')->where('memberstatus','<>','child')->whereNull('deleted_at')->select('id','surname','firstname','email','cellphone','household_id')->get();
    }
}<commit_msg>Fix Repo for messaging whole church<commit_after><?php namespace Bishopm\Connexion\Repositories;

use Bishopm\Connexion\Repositories\EloquentBaseRepository;

class IndividualsRepository extends EloquentBaseRepository
{
	public function dropdown(){
    	return $this->model->orderBy('surname', 'ASC')->select('id','surname','firstname')->get();
  	}

  	public function findBySlug($slug)
    {
        return $this->model->with('sermons','blogs')->where('slug', $slug)->first();
    }

    public function getName($id)
    {
    	$indiv=$this->model->find($id);
    	return $indiv->firstname . " " . $indiv->surname;
    }

    public function forEmail($email)
    {
        $hhh=$this->model->with('household')->where('email', $email)->select('household_id')->first();
        if ($hhh){
            if ($hhh->household){
                $household=$hhh->household_id;
                return $this->model->where('household_id', $household)->select('id','surname','firstname')->get();   
            } else {
                return "No data";    
            }
        } else {
            return "No data";
        }
    }

    public function givingnumbers()
    {
        $giving=$this->model->where('giving','>',0)->select('giving')->orderBy('giving')->get();
        $pg=array();
        foreach ($giving as $give){
            $pg[]=$give->giving;
        }
        return $pg;
    }

    public function allchurchmembers()
    {
        return $this->model->has('household')->where('memberstatus', 'member')->whereNull('deleted_at')->select('id','surname','firstname','email','cellphone','household_id')->get();
    }

    public function everyone()
    {
        return $this->model->has('household')->where('memberstatus','<>','child')->whereNull('deleted_at')->select('id','surname','firstname','email','cellphone','household_id')->get();
    }
}
{'fraction_non_alphanumeric': 0.1983739837398374, 'fraction_numerical': 0.0005420054200542005, 'mean_word_length': 3.038293216630197, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1357841', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1085, 'n_words': 149}