Download the PHP package w2w/laravel-apie without Composer

On this page you can find all versions of the php package w2w/laravel-apie. 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-apie

laravel-apie

Laravel wrapper for the apie library CircleCI codecov Travis Scrutinizer Code Quality

What does it do

This is a small wrapper around the library w2w/apie for Laravel. This library maps simple POPO's (Plain Old PHP Objects) to REST api calls. It is very similar to the excellent api platform library, but then for Laravel.

It also adds a class EloquentModelDataLayer to persist and retrieve api resources as Eloquent models and adds a status check to see if it can connect with the database. See the documentation of apie at https://github.com/pjordaan/apie

Forwards compatiblity Apie version 4

By default laravel-apie will still use the old 3. serialization. In Apie version 4 this will change drastically, so a config option is added to enable the forwards compatible 4. release.

Contents

  1. Installation
  2. Lumen integration
  3. Adding a a new api resource
  4. Automate registering classes
  5. Hooking in the laravel/lumen error handler
  6. Optimizations for production
  7. Versioning
  8. Integrate Eloquent with Apie
  9. Custom normalizers/value objects
  10. Modifying OpenAPI spec
  11. Use your own controllers
  12. Resource sub actions
  13. Laravel components integration
  14. PSR6 Cache integration
  15. L5-swagger integration
  16. Localization aware API

Installation

In your Laravel package you should do the usual steps to install a Laravel package.

In case you have no autodiscovery on to add W2w\Laravel\Apie\Providers\ApiResourceServiceProvider::class to your list of service providers manually.

Afterwards run the commands to publish the config to apie.php and run the migrations for the status checks.

Now visit /swagger-ui to see the generated OpenApi spec. It will only contain specs for the default installed api resources, which is a check to identify your REST API and a health check resource. It will check if it can connect to the database.

Adding a new api resource

create this class in your app/ApiResources:

Now in config/apie.php we should add the class to add it to the api resources:

If you refresh /api/doc.json you can see you get an extra POST call to create a SumExample resource. With any OpenApi tool or with Postman you can test the POST command. If you would make a POST call to /api/sum_example with body

You would get:

Automate registering api resources.

It is possible to automate registering api resources without having to manually update the resources list in config/apie.php We can auto-register all classes in a specific namespace with this:

Now if I put a class inside the namespace App\RestApi\ApiResources, the class will be registered for Apie.

Make sure that for production you use laravel's config cache to reduce load on your server.


All versions of laravel-apie with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
doctrine/annotations Version ^1.7
doctrine/cache Version ^1.8
illuminate/container Version ^5.6|^6.0|^7.0
illuminate/contracts Version ^5.6|^6.0|^7.0
illuminate/database Version ^5.6|^6.0|^7.0
illuminate/http Version ^5.6|^6.0|^7.0
illuminate/routing Version ^5.6|^6.0|^7.0
ramsey/uuid Version ^3.8
symfony/cache Version ^4.4|^5.0
symfony/options-resolver Version ^4.4|^5.0
symfony/psr-http-message-bridge Version ^1.2
symfony/serializer Version ^4.4|^5.0
w2w/apie Version ^3.4.2
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 w2w/laravel-apie contains the following files

Loading the files please wait ....