\App\Http\ControllersPostController

Controller for Posts This includes the Upload, showing/editing posts and zip download

Summary

Methods
Properties
Constants
__construct()
showUploadView()
uploadPost()
showPostsView()
showViewPostView()
showEditPostView()
update()
deletePost()
getZipDownload()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

showUploadView()

showUploadView() : \Illuminate\Contracts\View\Factory|\Illuminate\View\View

Show Upload View

Returns

\Illuminate\Contracts\View\Factory|\Illuminate\View\View

uploadPost()

uploadPost(\Illuminate\Http\Request  $request) : \Illuminate\Contracts\View\Factory|\Illuminate\View\View

Create a Post with title, description, owner

Parameters

\Illuminate\Http\Request $request

sent from the frontend

Returns

\Illuminate\Contracts\View\Factory|\Illuminate\View\View —

list of posts

showPostsView()

showPostsView(\Illuminate\Http\Request  $request) : \Illuminate\Contracts\View\Factory|\Illuminate\View\View

Show a list of all Posts

Parameters

\Illuminate\Http\Request $request

Returns

\Illuminate\Contracts\View\Factory|\Illuminate\View\View

showViewPostView()

showViewPostView(  $id) : \Illuminate\Contracts\View\Factory|\Illuminate\View\View

Show a specific Post

Parameters

$id

of the post

Returns

\Illuminate\Contracts\View\Factory|\Illuminate\View\View —

Post view

showEditPostView()

showEditPostView(  $id) : \Illuminate\Contracts\View\Factory|\Illuminate\View\View

Show a specific Post to edit Only staff or the owner can edit a post

Parameters

$id

of the Post

Returns

\Illuminate\Contracts\View\Factory|\Illuminate\View\View —

Edit Post edit view

update()

update(  $id, \Illuminate\Http\Request  $request) : \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector

Uodate a specific Post with a title, description, tags and files

Parameters

$id

of the post

\Illuminate\Http\Request $request

containing the new Post information

Returns

\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector

deletePost()

deletePost(  $idToDelete, \Illuminate\Http\Request  $request) : \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector

Delete a specific Post

Parameters

$idToDelete

of the post

\Illuminate\Http\Request $request

Throws

\Exception

Returns

\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector —

to the List of posts view

getZipDownload()

getZipDownload(\App\Post  $post) : \Symfony\Component\HttpFoundation\BinaryFileResponse

Downloads all the files from a post into a zip.

Parameters

\App\Post $post

to download as a zip

Returns

\Symfony\Component\HttpFoundation\BinaryFileResponse —

zip download file