public function store(array $data)
    {
        DB::transaction(function() use($data) {
            $model = $this->storeNotificationInstance($data);
            foreach ($data['title'] as $langId => $content) {
                $model->contents()->save($model->contents()->getModel()->newInstance([
                            'notification_id' => $model->id,
                            'lang_id'         => $langId,
                            'title'           => $content,
                            'content'         => $data['content'][$langId],
                            'subject'         => $data['subject'][$langId]
                ]));
            }
        });
    }
public function store(array $data)
    {
        DB::transaction(function() use($data) {
            $model = $this->storeNotificationInstance($data);
            foreach ($data['title'] as $langId => $content) {
                $model->contents()->save($model->contents()->getModel()->newInstance([
                            'notification_id' => $model->id,
                            'lang_id'         => $langId,
                            'title'           => $content,
                            'content'         => $data['content'][$langId],
                            'subject'         => $data['subject'][$langId]
                ]));
            }
        });
    }
public function store ( array $ data ) { DB :: transaction ( function ( ) use ( $ data ) { $ model = $ this -> storeNotificationInstance ( $ data ) ; foreach ( $ data [ 'title' ] as $ langId => $ content ) { $ model -> contents ( ) -> save ( $ model -> contents ( ) -> getModel ( ) -> newInstance ( [ 'notification_id' => $ model -> id , 'lang_id' => $ langId , 'title' => $ content , 'content' => $ data [ 'content' ] [ $ langId ] , 'subject' => $ data [ 'subject' ] [ $ langId ] ] ) ) ; } } ) ; }
stores new notification

@param array $data
stores new notification