Skip to content

Commit

Permalink
Update example to match Laravel 11's defaults
Browse files Browse the repository at this point in the history
In Laravel 11, the base controller (i.e. App\Http\Controllers\Controller) no longer uses the ValidatesRequests trait, which means that $this->validate() is no longer available in the context of controllers by default.
  • Loading branch information
matt-daneshvar authored Apr 28, 2024
1 parent ae900b8 commit 245cd3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class SurveyEntriesController extends Controller
{
public function store(Survey $survey, Request $request)
{
$answers = $this->validate($request, $survey->rules);
$answers = $request->validate($request, $survey->rules);

(new Entry)->for($survey)->fromArray($answers)->push();
}
Expand Down

0 comments on commit 245cd3e

Please sign in to comment.