PHP Class App\Http\Controllers\BlogController

Inheritance: extends Controller
Afficher le fichier Open project: forehalo/materialize-blog

Protected Properties

Свойство Type Description
$blog App\Repositories\PostRepository BlogRepository object.
$comment App\Repositories\CommentRepository CommentRepository object.

Méthodes publiques

Méthode Description
__construct ( PostRepository $blog, CommentRepository $comment ) BlogController constructor.
backIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View For back-end posts index.
body ( Illuminate\Http\Request $request, string $id ) : Illuminate\Contracts\View\Factory | Illuminate\Http\JsonResponse | Illuminate\View\View Get post body through ajax or redirect to 404.
comments ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse Get comments belong to post gotten by {id}
create ( ) : Illuminate\Http\Response Show the form for creating a new resource.
destroy ( integer $id ) : Illuminate\Http\Response Remove the specified resource from storage.
edit ( integer $id ) : Illuminate\Http\Response Show the form for editing the specified resource.
favorite ( Illuminate\Http\Request $request, $id )
frontIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Display posts list order by created_at This controller return posts shown in collapsible view.
getUpload ( ) Get upload page
index ( ) : Illuminate\Http\Response Get all posts and make pagination.
normalIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Unlike 'frontIndex', this action used to show normal list of posts and post clicked will be shown in a single page.
publish ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse Toggle post published status.
search ( Illuminate\Http\Request $request ) : Illuminate\Contracts\View\Factory | Illuminate\Http\RedirectResponse | Redirector | Illuminate\View\View Search in all posts.
show ( string $slug ) : Illuminate\Http\Response Display the specified resource.
store ( PostRequest $request ) : Illuminate\Http\Response Store a newly created resource in storage.
update ( Illuminate\Http\Request $request, integer $id ) : Illuminate\Http\Response Update the specified resource in storage.
upload ( Illuminate\Http\Request $request ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Upload File with Markdown Form.

Method Details

__construct() public méthode

BlogController constructor.
public __construct ( PostRepository $blog, CommentRepository $comment )
$blog App\Repositories\PostRepository
$comment App\Repositories\CommentRepository

backIndex() public méthode

For back-end posts index.
public backIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
Résultat Illuminate\Contracts\View\Factory | Illuminate\View\View

body() public méthode

Get post body through ajax or redirect to 404.
public body ( Illuminate\Http\Request $request, string $id ) : Illuminate\Contracts\View\Factory | Illuminate\Http\JsonResponse | Illuminate\View\View
$request Illuminate\Http\Request
$id string format: post-{id}
Résultat Illuminate\Contracts\View\Factory | Illuminate\Http\JsonResponse | Illuminate\View\View

comments() public méthode

Get comments belong to post gotten by {id}
public comments ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse
$request Illuminate\Http\Request
$id
Résultat Illuminate\Http\JsonResponse

create() public méthode

Show the form for creating a new resource.
public create ( ) : Illuminate\Http\Response
Résultat Illuminate\Http\Response

destroy() public méthode

Remove the specified resource from storage.
public destroy ( integer $id ) : Illuminate\Http\Response
$id integer
Résultat Illuminate\Http\Response

edit() public méthode

Show the form for editing the specified resource.
public edit ( integer $id ) : Illuminate\Http\Response
$id integer
Résultat Illuminate\Http\Response

favorite() public méthode

public favorite ( Illuminate\Http\Request $request, $id )
$request Illuminate\Http\Request

frontIndex() public méthode

Display posts list order by created_at This controller return posts shown in collapsible view.
public frontIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
Résultat Illuminate\Contracts\View\Factory | Illuminate\View\View

getUpload() public méthode

Get upload page
public getUpload ( )

index() public méthode

Get all posts and make pagination.
public index ( ) : Illuminate\Http\Response
Résultat Illuminate\Http\Response

normalIndex() public méthode

Unlike 'frontIndex', this action used to show normal list of posts and post clicked will be shown in a single page.
public normalIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
Résultat Illuminate\Contracts\View\Factory | Illuminate\View\View

publish() public méthode

Toggle post published status.
public publish ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse
$request Illuminate\Http\Request
$id
Résultat Illuminate\Http\JsonResponse

show() public méthode

Display the specified resource.
public show ( string $slug ) : Illuminate\Http\Response
$slug string post url slug
Résultat Illuminate\Http\Response

store() public méthode

Store a newly created resource in storage.
public store ( PostRequest $request ) : Illuminate\Http\Response
$request App\Http\Requests\PostRequest
Résultat Illuminate\Http\Response

update() public méthode

Update the specified resource in storage.
public update ( Illuminate\Http\Request $request, integer $id ) : Illuminate\Http\Response
$request Illuminate\Http\Request
$id integer
Résultat Illuminate\Http\Response

upload() public méthode

Upload File with Markdown Form.
public upload ( Illuminate\Http\Request $request ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
$request Illuminate\Http\Request
Résultat Illuminate\Contracts\View\Factory | Illuminate\View\View

Property Details

$blog protected_oe property

BlogRepository object.
protected PostRepository,App\Repositories $blog
Résultat App\Repositories\PostRepository

$comment protected_oe property

CommentRepository object.
protected CommentRepository,App\Repositories $comment
Résultat App\Repositories\CommentRepository