post = Post::raw(function($collection) { return $collection->aggregate([ ['$match' => ['featured' => 'on']], ['$sample' => ['size' => 1]] ]); })->first(); $this->tags = $this->post->tags()->take(5)->get(); } public function placeholder() { return <<
HTML; } public function render() { if ($this->post == null) { return view('livewire.post-feature-empty'); } return view('livewire.post-feature'); } }