Skip to content

Commit

Permalink
Updated comments on controller method
Browse files Browse the repository at this point in the history
  • Loading branch information
waleedahmad committed Sep 22, 2018
1 parent dc1db8f commit 819dd5c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/Http/Controllers/VideoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,29 @@
class VideoController extends Controller
{

/**
* Return video blade view and pass videos to it.
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$videos = Video::orderBy('created_at', 'DESC')->get();
return view('videos')->with('videos', $videos);
}

/**
* Return uploader form view for uploading videos
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function uploader(){
return view('uploader');
}

/**
* Handles form submission after uploader form submits
* @param StoreVideoRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(StoreVideoRequest $request)
{
$path = str_random(16) . '.' . $request->video->getClientOriginalExtension();
Expand All @@ -34,7 +47,7 @@ public function store(StoreVideoRequest $request)

ConvertVideoForStreaming::dispatch($video);

return redirect('/uploader')
return redirect('/')
->with(
'message',
'Your video will be available shortly after we process it'
Expand Down

0 comments on commit 819dd5c

Please sign in to comment.