Home  >  Article  >  PHP Framework  >  How to solve the problem that laravel converts empty values ​​​​to null by default

How to solve the problem that laravel converts empty values ​​​​to null by default

little bottle
little bottleforward
2019-04-22 11:43:095543browse

The main content of this article is about solving the problem of laravel converting empty values ​​to null by default. Interested friends can learn more.

If the field we submit during form submission is an empty string, it will be automatically escaped to Null in Laravel.

How to deal with this problem until you find the middleware\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\<span class="token class-name">ConvertEmptyStringsToNull </span>

Comment out the conversion operation

Related tutorials: laravel video tutorial

The above is the detailed content of How to solve the problem that laravel converts empty values ​​​​to null by default. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete