Dingo\Api\Routing\Router::version PHP Method

version() public method

This method can be called without the third parameter, however, the callback should always be the last paramter.
public version ( string $version, array | callable $second, callable $third = null ) : void
$version string
$second array | callable
$third callable
return void
    public function version($version, $second, $third = null)
    {
        if (func_num_args() == 2) {
            list($version, $callback, $attributes) = array_merge(func_get_args(), [[]]);
        } else {
            list($version, $attributes, $callback) = func_get_args();
        }
        $attributes = array_merge($attributes, ['version' => $version]);
        $this->group($attributes, $callback);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Bootstrap any application services.
  *
  * @param Router $api
  */
 public function boot(Router $api)
 {
     $path = app_path('Api/routes.php');
     $api->version('v1', ['namespace' => $this->namespace], function ($api) use($path) {
         require $path;
     });
 }
All Usage Examples Of Dingo\Api\Routing\Router::version