如下是一段API路由:
<?php
use Illuminate\Http\Request;
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', [
'namespace' => 'App\Http\Controllers\Api'
], function($api) {
// 短信验证码
$api->post('verificationCodes', 'VerificationCodesController@store')
->name('api.verificationCodes.store');
});
不明白为啥每个路由后面都写个name方法:name('api.verificationCodes.store')
在文档中没有搜到该方法
请问这是什么作用?括号里面参数为什么这么写?哪里有详细的文档可以解读?
https://laravel.com/docs/5.7/...