Skip to content

Instantly share code, notes, and snippets.

@Konafets
Last active October 26, 2017 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Konafets/c63750bf6063bb36b44d410132d49582 to your computer and use it in GitHub Desktop.
Save Konafets/c63750bf6063bb36b44d410132d49582 to your computer and use it in GitHub Desktop.
Merge validation rules
<?php namespace App\Http\Requests;
use App\Models\BlogPost;
use Illuminate\Foundation\Http\FormRequest;
class PostStoreRequest extends FormRequest
{
public function rules()
{
return array_merge(BlogPost::$createRules, Author::$createRules);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment