/** * Get the widget data to send to the view * @return string */ protected function data() { $limit = $this->setting->get('blog::latest-posts-amount', locale(), 5); return ['posts' => $this->post->latest($limit)]; }
public function compose(View $view) { $limit = $this->setting->get('blog::latest-posts-amount', locale(), 5); $view->with('latestPosts', $this->post->latest($limit)); }