Download the PHP package dongivan/laravel-route-versioning without Composer

On this page you can find all versions of the php package dongivan/laravel-route-versioning. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-route-versioning

Laravel Route Versioning

ENGLISH

这个包提供了Laravel下的根据Http请求头进行版本化路由功能。

功能

安装

使用

插入容器

使用这个包需要修改 bootstrap/app.php 以获得对容器中 "router" 的控制。

实际上,这一步需要在 Kernel 得到初始化之前完成(一般发生在 public/index.php 文件中),否则当 Kernel 由容器创建时,默认的 Illuminate\Routing\Router 将被初始化。

为路由设置版本

\Dongivan\RouteVersioning\Router 被插入容器后,Facade Router 可以使用version

使用\Dongivan\RouteVersioning\Facades\Route来代替\Illuminate\Support\Facades\Route的话可以得到IDE的更多提示。

设置字符串版本

设置字符串版本时,可以设置为 vX.Y.Z 或者 X.Y.Z 这样的格式。但是不支持其它格式,如 v2.0.0-rc1v2.1.3.5

为Group设置版本

为Resource设置版本

不设置版本

没有设置版本的路由将被认为有一个null值的版本,而这个版本在版本回落时将拥有最低优先级。

配置文件

如果需要修改请求头中Version的键或者修改版本回落策略,可以创建一个 config/route-version.php 文件,并写入以下内容:

版本回落

config("route-version.strict") === false

x-version: null v1 v1.2 v1.5 v1.8 v1.10 v1.15 v2 v3
Route::get() - - - - - - - - -
Route::version("v1")->get() - - - - - - -
Route::version("v1.5")->get() - - - - - - -
Route::version("v1.10")->get() - - - - - - -
Route::version("v2")->get() - - - - - -

小心:没有版本的路由将回落至最高版本。

config("route-version.strict") === true

x-version: null v1 v1.2 v1.5 v1.8 v1.10 v1.15 v2 v3
Route::get() - - - - - - - -
Route::version("v1")->get() - - - - - - - -
Route::version("v1.5")->get() - - - - - - - -
Route::version("v1.10")->get() - - - - - - - -
Route::version("v2")->get() - - - - - - - -

小心:如果 strict 设置为 true 则将不进行版本回落。

缓存

请使用 artisan 来完成:

Laravel 使用了 Symfony 来对路由进行编译,所以为了解析缓存路由的版本比较,我们需要库 symfony/expression-language

协议

MIT 许可 (MIT).


All versions of laravel-route-versioning with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.2
illuminate/routing Version ^9.39
symfony/expression-language Version ^6.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dongivan/laravel-route-versioning contains the following files

Loading the files please wait ....