<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;
use Zizaco\Entrust\Traits\EntrustUserTrait;

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

    public function getNomUserAttribute()
    {

    	$user=User::find($this->user_id);
        
        if(!$user) return "";
        return $user->login;
    }

	

}
