Laravel 5.5 – Validation Data Return – New Feature

Laravel 5.5 – Validation Data Return – New Feature

In this post we will give you information about Laravel 5.5 – Validation Data Return – New Feature. Hear we will give you detail about Laravel 5.5 – Validation Data Return – New FeatureAnd how to use it also give you demo for it if it is necessary.

laravel released 5.5 version a few days ago and they also introduce several new feature. So in this post i will let you know one new feature, they provide new way to validation check using request() and validate().

In this post i will give you three way to check validation and store input data into variable. So let’s simple see how we can check and return back to validation. so just check bellow way to check validation:

Example 1:

public function store()

{

$this->validate(request(), [

'name' => 'required',

'email' => 'required|email'

]);


return User::create(request()->all());

}

Example 2:

public function store()

{

$user = $this->validate(request(), [

'name' => 'required',

'email' => 'required|email'

]);


return User::create($user);

}

Example 3:

Also see:Laravel 5.4 New Feature – Add new Components & Slots in Blade Template

public function store()

{

$user = request()->validate([

'name' => 'required',

'email' => 'required|email'

]);


return User::create($user);

}

i hope it can help you….

Hope this code and post will helped you for implement Laravel 5.5 – Validation Data Return – New Feature. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  39  =  47

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US