reindert-vetter / api-version-control Goto Github PK
View Code? Open in Web Editor NEWA Laravel package to manage versions of endpoints in an elegant way
License: MIT License
A Laravel package to manage versions of endpoints in an elegant way
License: MIT License
It looks like this does not work with Laravel 6 or higher because it requires illuminate/routing ~5.7.12
.
Given documented example for defining api routes without version prefix in addition to versioned routes.
Route::middleware(['api', ApiVersionControl::class])
->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware(['api', ApiVersionControl::class])
->prefix('api/{version}')
->where(['version', '#[a-z]\d{1,3}#'])
->group(base_path('routes/api.php'));
I was unable to cache my named routes as it was warning me that the name was already in use. I mitigated this issue by defining a group as name.
Route::middleware(['api', ApiVersionControl::class])
->prefix('api')
->as('default.')
->group(base_path('routes/api.php'));
Route::middleware(['api', ApiVersionControl::class])
->prefix('api/{version}')
->where(['version', '#[a-z]\d{1,3}#'])
->group(base_path('routes/api.php'));
Getting exception Attempt to assign property "permit" on string
when I am trying to implement a test version statement.
It looks like this does not work with Laravel 6 or higher because it requires illuminate/routing ~5.7.12
.
It looks like currently the documentation is using slightly wrong syntax for Regular Expression Parameter Constraints
Current documentation is using syntax ->where(['version', '#[a-z]\d{1,3}#'])
but i believe this should either be
->where('version', '#[a-z]\d{1,3}#')
or
->where(['version' => '#[a-z]\d{1,3}#'])
Hello
I was installing the package into a Laravel 8.4 installation, and received the below error when trying to publish the config
Below the trace of the commands + the output
> composer require reindert-vetter/api-version-control
Using version ^2.1 for reindert-vetter/api-version-control
./composer.json has been updated
Running composer update reindert-vetter/api-version-control
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking reindert-vetter/api-version-control (2.1.5)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading reindert-vetter/api-version-control (2.1.5)
- Installing reindert-vetter/api-version-control (2.1.5): Extracting archive
Package sebastian/resource-operations is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Class App\Http\Controllers\Auth\V1\ResetPasswordController located in ./app/Http/Controllers/API/V1/ResetPasswordController.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: kreait/laravel-firebase
Discovered Package: laravel-notification-channels/fcm
Discovered Package: laravel/sail
Discovered Package: laravel/sanctum
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: sentry/sentry-laravel
Discovered Package: spatie/laravel-http-logger
Discovered Package: spatie/laravel-permission
Package manifest generated successfully.
91 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> php artisan vendor:publish --provider='ReindertVetter\ApiVersionControl\ApiVersionControlServiceProvider'
Unable to locate publishable resources.
Publishing complete.
Appreciate the help!
Laravel Framework 8.55.0
[InvalidArgumentException]
Package reindert-vetter/api-version-control has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.