/** * @param $id * * @throws NotFoundException * * @return array */ public static function getTemplateDataById($id) { // find template in system db $template = EmailTemplate::whereId($id)->first(); if (empty($template)) { throw new NotFoundException("Email Template id '{$id}' not found"); } return $template->toArray(); }