1 @if ($errors->any())
2 @foreach ($errors->all() as $error)
3 <div>{{$error}}</div>
4 @endforeach
5 @endif
6
1/**
2 * Store a new blog post.
3 *
4 * @param Request $request
5 * @return Response
6 */
7public function store(Request $request)
8{
9 $validatedData = $request->validate([
10 'title' => 'required|unique:posts|max:255',
11 'body' => 'required',
12 ]);
13
14 // The blog post is valid...
15}