BlogPostService
in package
Class BlogPostService.
Table of Contents
Methods
- findBySlug() : BlogPost
- getAllPosts() : Collection
- getPaginatedPosts() : LengthAwarePaginator
- latestPosts() : Collection
- randomPosts() : Collection
Methods
findBySlug()
public
findBySlug(string $slug) : BlogPost
Parameters
- $slug : string
Return values
BlogPostgetAllPosts()
public
getAllPosts() : Collection
Return values
CollectiongetPaginatedPosts()
public
getPaginatedPosts([int|null $perPage = null ][, int|null $page = null ]) : LengthAwarePaginator
Parameters
- $perPage : int|null = null
- $page : int|null = null
Return values
LengthAwarePaginatorlatestPosts()
public
latestPosts([mixed $limit = 6 ]) : Collection
Parameters
- $limit : mixed = 6
Return values
CollectionrandomPosts()
public
randomPosts([mixed $limit = 6 ]) : Collection
Parameters
- $limit : mixed = 6