script
<!-- ajax submits the current form-->
<script type="text/javascript">
$(function(){
$('#register').on('click',function(){
use -- to submit user information
$.ajax({
'post',
url: "{:url('insert')}&q
public function insert()
{ //The front-end submission must be an Ajax request and then verify and add new operations
if (Request::isAjax()) {
//1. Data verification
$data = Request::post(); //Data to be verified
$rule = 'app\common\validate\User'; //Customized validator
Let’s see what error the system reports when making a request