Esempio n. 1
0
 public static function sortSelectValues()
 {
     $values = [];
     $max_sort_number = Faq::count();
     for ($i = 1; $i <= $max_sort_number; $i++) {
         $values[$i] = '# ' . $i;
     }
     $values[$i] = '# ' . $i;
     return $values;
 }
Esempio n. 2
0
 public static function tagValues()
 {
     $values = [];
     $faqs = Faq::select('tags')->get();
     foreach ($faqs as $index => $faq) {
         $tags = $faq->tags;
         foreach ($tags as $index => $tag) {
             if (!in_array($tag, $values)) {
                 $values[] = $tag;
             }
         }
     }
     sort($values);
     return $values;
 }