Last active
October 26, 2017 13:09
-
-
Save Konafets/78a82b0647946ed1bdf0dea7f8d82146 to your computer and use it in GitHub Desktop.
In-Action Validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Controllers; | |
use App\Http\Controllers\Controller; | |
class PostController extends Controller | |
{ | |
public function store(Request $request) | |
{ | |
$validatedData = $request->validate([ | |
'title' => 'required|unique:posts|max:255', | |
'body' => 'required', | |
]); | |
// The blog post is valid... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment