validate rules when you want to edit post?

Posted 11 months ago by gidaban79

Hello guys,

at the beginning i would like to as about best way for validate date before put to database but only when i want to edit post.

i have fields 'title' 'body' 'poster'

$this->validate($request->all(),
[
        'title' => 'required|unique:blogs|max:190',
                'description' => 'required',
                'poster' => 'required|image|max:51200'
] );

that is simple validation when i add post

how should looks validation rules in update post ?

Please sign in or create an account to participate in this conversation.