App\Http\Controllers\Forum\ForumCoversController::update PHP Method

update() public method

public update ( $id )
    public function update($id)
    {
        $cover = ForumCover::findOrFail($id);
        if (Request::hasFile('cover_file') === true) {
            try {
                $cover = $cover->updateFile(Request::file('cover_file')->getRealPath(), Auth::user());
            } catch (ImageProcessorException $e) {
                return error_popup($e->getMessage());
            }
        }
        return json_item($cover, new ForumCoverTransformer());
    }