Full Stack LAMP - MEAN Developer, Python developer. Certified Azure Developer. Freelance programmer/consultant/trainer.

Laravel 5.6 – New @method and @csrf Blade Directives

Laravel is gonna introduce two new Blade Directives as part of 5.6 release, @method and @csrf Directives.

In the current Laravel 5.5 version, we are doing the following at the top of forms to create hidden inputs for the CSRF token and the spoofed HTTP method –

{{ csrf_field() }} {{ method_field('PUT') }} ..... ....... ......

In the Version 5.6, you can use new Blade Directives as shown below to create hidden inputs for the CSRF token and the spoofed HTTP method

@method('put') @csrf ..... ....... ......

Below is the reference link –
https://github.com/laravel/framework/commit/5f1984421af096ef21b7d2011949a233849d4ee3

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments