PHP Class Corcel\PostBuilder

Inheritance: extends Illuminate\Database\Eloquent\Builder
Show file Open project: jgrossi/corcel Class Usage Examples

Public Methods

Method Description
paged ( integer $perPage = 10, integer $currentPage = 1 ) : Illuminate\Database\Eloquent\Collection Paginate the results
published ( ) : PostBuilder Get only published posts
slug ( $slug ) : PostBuilder Get only posts with a specific slug
status ( string $postStatus ) : PostBuilder Get only posts with a custom status
taxonomy ( $taxonomy, $term )
type ( string $type ) : PostBuilder Get only posts from a custom post type
typeIn ( array $type ) : PostBuilder Get only posts from an array of custom post types

Method Details

paged() public method

Paginate the results
public paged ( integer $perPage = 10, integer $currentPage = 1 ) : Illuminate\Database\Eloquent\Collection
$perPage integer
$currentPage integer
return Illuminate\Database\Eloquent\Collection

published() public method

Get only published posts
public published ( ) : PostBuilder
return PostBuilder

slug() public method

Get only posts with a specific slug
public slug ( $slug ) : PostBuilder
return PostBuilder

status() public method

Get only posts with a custom status
public status ( string $postStatus ) : PostBuilder
$postStatus string
return PostBuilder

taxonomy() public method

public taxonomy ( $taxonomy, $term )

type() public method

Get only posts from a custom post type
public type ( string $type ) : PostBuilder
$type string
return PostBuilder

typeIn() public method

Get only posts from an array of custom post types
public typeIn ( array $type ) : PostBuilder
$type array
return PostBuilder