src/Repository/Repository.php
protected function storeNotificationInstance(array $data)
    {

        is_null($typeId = array_get($data, 'type_id')) ? $typeId = app(NotificationTypes::class)->where('name', array_get($data, 'type'))->first()->id : null;
        $model  = $this->model->getModel()->newInstance([
            'category_id' => array_get($data, 'category'),
            'type_id'     => $typeId,
            'active'      => array_get($data, 'active', 1),
            'severity_id' => NotificationSeverity::medium()->first()->id,
            'event'       => config('antares/notifications::default.custom_event')
        ]);
        $model->save();
        return $model;
    }
protected function storeNotificationInstance(array $data)
    {

        is_null($typeId = array_get($data, 'type_id')) ? $typeId = app(NotificationTypes::class)->where('name', array_get($data, 'type'))->first()->id : null;
        $model  = $this->model->getModel()->newInstance([
            'category_id' => array_get($data, 'category'),
            'type_id'     => $typeId,
            'active'      => array_get($data, 'active', 1),
            'severity_id' => NotificationSeverity::medium()->first()->id,
            'event'       => config('antares/notifications::default.custom_event')
        ]);
        $model->save();
        return $model;
    }
protected function storeNotificationInstance ( array $ data ) { is_null ( $ typeId = array_get ( $ data , 'type_id' ) ) ? $ typeId = app ( NotificationTypes :: class ) -> where ( 'name' , array_get ( $ data , 'type' ) ) -> first ( ) -> id : null ; $ model = $ this -> model -> getModel ( ) -> newInstance ( [ 'category_id' => array_get ( $ data , 'category' ) , 'type_id' => $ typeId , 'active' => array_get ( $ data , 'active' , 1 ) , 'severity_id' => NotificationSeverity :: medium ( ) -> first ( ) -> id , 'event' => config ( 'antares/notifications::default.custom_event' ) ] ) ; $ model -> save ( ) ; return $ model ; }
Stores notification instance details

@param array $data
@return Model
Stores notification instance details