original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: Gets notification contents
  
  @param String $type
  @return \Antares\Support\Collection
docstring_tokens: Gets notification contents