public function getNotificationContents($type = null)
    {
        return NotificationContents::select(['title', 'id'])
                        ->whereHas('lang', function($query) {
                            $query->where('code', locale());
                        })
                        ->whereHas('notification', function($query) use($type) {
                            if (is_null($type)) {
                                $query->whereHas('type', function($subquery) {
                                    $subquery->whereIn('name', ['sms', 'email']);
                                });
                            } elseif (is_numeric($type)) {
                                $query->where('type_id', $type);
                            } elseif (is_string($type)) {
                                $query->whereHas('type', function($subquery) use($type) {
                                    $subquery->where('name', $type);
                                });
                            }
                        })->get();
    }