<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class EmailAddress extends Model { protected $fillable = [ 'email','from','status', ]; public function admin(){ return $this->belongsTo(User::class,'admin_id')->withDefault(); } public function customer_emails(){ return $this->hasMany(CustomerMail::class); } public function getStatusAttribute($value) { return ucfirst($value); } }