public function putAppeal(Board $board, Ban $ban) { if (!$ban->canAppeal() || !$ban->isBanForIP()) { return abort(403); } $input = Input::all(); $validator = Validator::make($input, ['appeal_text' => ["string", "between:0,2048"]]); if (!$validator->passes()) { return redirect()->back()->withErrors($validator->errors()); } $appeal = $ban->appeals()->create(['appeal_ip' => inet_pton(Request::ip()), 'appeal_text' => $input['appeal_text']]); $ban->setRelation('appeals', $ban->appeals->push($appeal)); return $this->getBan($board, $ban); }