What is the role of the name method in dingo/api?

is an API route as follows:

<?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");
});

I don"t understand why each route is followed by a name method: name ("api.verificationCodes.store")
this method is not found in the document
what is the purpose of this? Why are the parameters in parentheses written like this? Where are the detailed documents to interpret?

Jun.06,2022

https://laravel.com/docs/5.7/...


Route alias, which can be set via

redirect()->route('api.verificationCodes.store');

make a route jump


this has nothing to do with dingo/api, but comes with laravel. Name is your routing alias. It is recommended to consult the laravel document at the following address: https://learnku.com/docs/lara...

.
Menu