PHP 클래스 App\Http\Controllers\BlogController

상속: extends Controller
파일 보기 프로젝트 열기: forehalo/materialize-blog

보호된 프로퍼티들

프로퍼티 타입 설명
$blog App\Repositories\PostRepository BlogRepository object.
$comment App\Repositories\CommentRepository CommentRepository object.

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

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

backIndex() 공개 메소드

For back-end posts index.
public backIndex ( ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
리턴 Illuminate\Contracts\View\Factory | Illuminate\View\View

body() 공개 메소드

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}
리턴 Illuminate\Contracts\View\Factory | Illuminate\Http\JsonResponse | Illuminate\View\View

comments() 공개 메소드

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

create() 공개 메소드

Show the form for creating a new resource.
public create ( ) : Illuminate\Http\Response
리턴 Illuminate\Http\Response

destroy() 공개 메소드

Remove the specified resource from storage.
public destroy ( integer $id ) : Illuminate\Http\Response
$id integer
리턴 Illuminate\Http\Response

edit() 공개 메소드

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

favorite() 공개 메소드

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

frontIndex() 공개 메소드

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

getUpload() 공개 메소드

Get upload page
public getUpload ( )

index() 공개 메소드

Get all posts and make pagination.
public index ( ) : Illuminate\Http\Response
리턴 Illuminate\Http\Response

normalIndex() 공개 메소드

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
리턴 Illuminate\Contracts\View\Factory | Illuminate\View\View

publish() 공개 메소드

Toggle post published status.
public publish ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse
$request Illuminate\Http\Request
$id
리턴 Illuminate\Http\JsonResponse

show() 공개 메소드

Display the specified resource.
public show ( string $slug ) : Illuminate\Http\Response
$slug string post url slug
리턴 Illuminate\Http\Response

store() 공개 메소드

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

update() 공개 메소드

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

upload() 공개 메소드

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

프로퍼티 상세

$blog 보호되어 있는 프로퍼티

BlogRepository object.
protected PostRepository,App\Repositories $blog
리턴 App\Repositories\PostRepository

$comment 보호되어 있는 프로퍼티

CommentRepository object.
protected CommentRepository,App\Repositories $comment
리턴 App\Repositories\CommentRepository