<?php namespace App\Models;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Zizaco\Entrust\HasRole;

class Beneftype extends Model {
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'benef_types';


	function getNombreBeneficiairesAttribute() {

		$t_types=explode(';',$this->statuts);
		$nb=Beneficiaire::whereIn('statut',$t_types)->count();

		return $nb;

	}	


}