Last active
October 26, 2017 13:56
-
-
Save Konafets/bfcfe7896292a1cd8dff86afb9a57c56 to your computer and use it in GitHub Desktop.
In-Action Validation with rules from Model
This file contains 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; | |
use App\Models\BlogPost; | |
class PostController extends Controller | |
{ | |
public function store(Request $request) | |
{ | |
$validatedData = $request->validate(BlogPost::$createRules); | |
// The blog post is valid... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment