title: How to call Laravel Accessor
body: <p>in Product Model </p>
  
  <pre><code>public function getPaginatedAttribute()
  {
      $posts = $this-&gt;posts;
  
      return \Paginator::make($posts, $posts-&gt;count(), 10);
  }
  </code></pre>
  
  <p>when call in controller</p>
  
  <pre><code>$product = Product::with('categories')-&gt;paginated();
  </code></pre>
  
  <p>always error </p>
  
  <pre><code>Call to undefined method Illuminate\Database\Query\Builder::paginated(); 
  </code></pre>