PHP Class App\Http\Controllers\ArchiveController

Inheritance: extends Controller
Show file Open project: forehalo/materialize-blog

Protected Properties

Property Type Description
$category App\Repositories\CategoryRepository CategoryRepository object.
$post App\Repositories\PostRepository PostRepository object.
$tag App\Repositories\TagRepository TagRepository object.

Public Methods

Method Description
__construct ( CategoryRepository $category, TagRepository $tag, PostRepository $post ) ArchiveController constructor.
groupByCategory ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Get all categories used to group posts.
groupByDate ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Get all posts grouped by create date.
groupByTag ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Get all Tags used to group posts.
showCategory ( $id ) : Illuminate\Http\RedirectResponse Redirect to categories with default category.
showTag ( $id ) : Illuminate\Http\RedirectResponse Redirect to tags with default tag.

Method Details

__construct() public method

ArchiveController constructor.
public __construct ( CategoryRepository $category, TagRepository $tag, PostRepository $post )
$category App\Repositories\CategoryRepository
$tag App\Repositories\TagRepository
$post App\Repositories\PostRepository

groupByCategory() public method

Get all categories used to group posts.
public groupByCategory ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
return Illuminate\Contracts\View\Factory | Illuminate\View\View

groupByDate() public method

Get all posts grouped by create date.
public groupByDate ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
return Illuminate\Contracts\View\Factory | Illuminate\View\View

groupByTag() public method

Get all Tags used to group posts.
public groupByTag ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
return Illuminate\Contracts\View\Factory | Illuminate\View\View

showCategory() public method

Redirect to categories with default category.
public showCategory ( $id ) : Illuminate\Http\RedirectResponse
$id
return Illuminate\Http\RedirectResponse

showTag() public method

Redirect to tags with default tag.
public showTag ( $id ) : Illuminate\Http\RedirectResponse
$id
return Illuminate\Http\RedirectResponse

Property Details

$category protected property

CategoryRepository object.
protected CategoryRepository,App\Repositories $category
return App\Repositories\CategoryRepository

$post protected property

PostRepository object.
protected PostRepository,App\Repositories $post
return App\Repositories\PostRepository

$tag protected property

TagRepository object.
protected TagRepository,App\Repositories $tag
return App\Repositories\TagRepository