PHP Class App\Http\Controllers\CommentsController

Inheritance: extends Controller
ファイルを表示 Open project: appkr/l5essential Class Usage Examples

Public Methods

Method Description
__construct ( )
destroy ( Illuminate\Http\Request $request, integer $id ) : Illuminate\Http\Response Remove the specified resource from storage.
recursiveDestroy ( App\Comment $comment ) : boolean | null Delete comment recursively
store ( Illuminate\Http\Request $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.
vote ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse Vote up or down for the given comment.

Protected Methods

Method Description
deleteVote ( $votes ) Delete given votes collection.

Method Details

__construct() public method

public __construct ( )

deleteVote() protected method

Delete given votes collection.
protected deleteVote ( $votes )
$votes

destroy() public method

Remove the specified resource from storage.
public destroy ( Illuminate\Http\Request $request, integer $id ) : Illuminate\Http\Response
$request Illuminate\Http\Request
$id integer
return Illuminate\Http\Response

recursiveDestroy() public method

Delete comment recursively
public recursiveDestroy ( App\Comment $comment ) : boolean | null
$comment App\Comment
return boolean | null

store() public method

Store a newly created resource in storage.
public store ( Illuminate\Http\Request $request ) : Illuminate\Http\Response
$request Illuminate\Http\Request
return Illuminate\Http\Response

update() public method

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

vote() public method

Vote up or down for the given comment.
public vote ( Illuminate\Http\Request $request, $id ) : Illuminate\Http\JsonResponse
$request Illuminate\Http\Request
$id
return Illuminate\Http\JsonResponse