MailEvent.php 497 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\LogModelChanging;
  5. use Illuminate\Database\Eloquent\Relations\BelongsToMany;
  6. class MailEvent extends Model
  7. {
  8. use LogModelChanging;
  9. protected $fillable = ['name', 'event_name', 'remark', 'is_active', 'template'];
  10. /**
  11. * @return BelongsToMany
  12. */
  13. public function roles(): BelongsToMany
  14. {
  15. return $this->belongsToMany(Role::class,'mail_event_role','mail_event_id','role_id');
  16. }
  17. }