protected function processSingle(array $data, $lang, $model)
    {
        is_null($view    = array_get($data, 'templates.' . $lang->code)) ? $view    = array_get($data, 'templates.' . $lang->code) : null;
        $content = '';
        if (is_null($view)) {
            $content = app($data['classname'])->render();
        } else {
            $path = view($view)->getPath();
            if (!file_exists($path)) {
                throw new Exception(trans('antares/notifications::messages.notification_view_not_exists', ['path' => $path]));
            }
            $content = file_get_contents($path);
        }

        return $model->contents()->save($model->contents()->getModel()->newInstance([
                            'notification_id' => $model->id,
                            'lang_id'         => $lang->id,
                            'title'           => array_get($data, 'title'),
                            'subject'         => array_get($data, 'subject'),
                            'content'         => $content
        ]));
    }
protected function processSingle(array $data, $lang, $model)
    {
        is_null($view    = array_get($data, 'templates.' . $lang->code)) ? $view    = array_get($data, 'templates.' . $lang->code) : null;
        $content = '';
        if (is_null($view)) {
            $content = app($data['classname'])->render();
        } else {
            $path = view($view)->getPath();
            if (!file_exists($path)) {
                throw new Exception(trans('antares/notifications::messages.notification_view_not_exists', ['path' => $path]));
            }
            $content = file_get_contents($path);
        }

        return $model->contents()->save($model->contents()->getModel()->newInstance([
                            'notification_id' => $model->id,
                            'lang_id'         => $lang->id,
                            'title'           => array_get($data, 'title'),
                            'subject'         => array_get($data, 'subject'),
                            'content'         => $content
        ]));
    }
protected function processSingle ( array $ data , $ lang , $ model ) { is_null ( $ view = array_get ( $ data , 'templates.' . $ lang -> code ) ) ? $ view = array_get ( $ data , 'templates.' . $ lang -> code ) : null ; $ content = '' ; if ( is_null ( $ view ) ) { $ content = app ( $ data [ 'classname' ] ) -> render ( ) ; } else { $ path = view ( $ view ) -> getPath ( ) ; if ( ! file_exists ( $ path ) ) { throw new Exception ( trans ( 'antares/notifications::messages.notification_view_not_exists' , [ 'path' => $ path ] ) ) ; } $ content = file_get_contents ( $ path ) ; } return $ model -> contents ( ) -> save ( $ model -> contents ( ) -> getModel ( ) -> newInstance ( [ 'notification_id' => $ model -> id , 'lang_id' => $ lang -> id , 'title' => array_get ( $ data , 'title' ) , 'subject' => array_get ( $ data , 'subject' ) , 'content' => $ content ] ) ) ; }
Process signle notification

@param array $data
@param \Antares\Translations\Models\Languages $lang
@param Notifications $model
@return boolean
@throws Exception
Process signle notification