Пример #1
0
 public function tearDown()
 {
     parent::tearDown();
     $taxonomy = TermTaxonomy::where('taxonomy', '=', 'stuff')->first();
     if ($taxonomy !== null) {
         $taxonomy->delete();
     }
 }
Пример #2
0
 public function categories()
 {
     $categories = array();
     $post_id = $this->ID;
     $related_taxonomies = TermTaxonomy::where('taxonomy', 'category')->whereHas('relationships', function ($q) use($post_id) {
         $q->where('object_id', $post_id);
     })->get();
     foreach ($related_taxonomies as $taxonomy) {
         $categories[] = $taxonomy->term()->first();
     }
     return $categories;
 }