Download the PHP package api-skeletons/laravel-hal-doctrine without Composer

On this page you can find all versions of the php package api-skeletons/laravel-hal-doctrine. 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-hal-doctrine

Laravel HAL Doctrine

Build Status Code Coverage PHP Version Laravel Version

This library provides a hydrator for laravel-hal for Doctrine. Instead of manually creating every hydrator for your entities, this library will introspect an entity and generate the HAL for it including links to other entities and collections for one to many relationships and embedding many to one and one to one entities.

A grouped minimal configuration file allows for excluded fields and associations and configures the routes for each entity.

Use

Create a hydrator manager

Extract an entity

will result in a HAL response like

Configuration

A hal-doctrine.php configuration file is required. Publish the included config to your project:

Doctrine\Laminas\Hydrator\DoctrineObject

The Laminas Hydrator is used by this library to extract data directly from entities. You must add this configuration to your doctrine.php configuration file:

Naming Strategy

The default naming strategy uses the Inflector's urlize() method to change 'associationName' into 'association-name'. If this is not the way you want to name your relationsihps or routes then create your own naming strategy and assign it in the config file.

Route naming

When using the routeNamePatterns to create a route name, the entity name becomes $namingStrategy->route($entityName) such as api.short-name::fetch according to the example configuration.

Filtering Collections

For extracted related collections, links will be created with filter options compatible with ApiSkeletons\Doctrine\QueryBuilder\Filter\Applicator to filter the collection data to just the extracted entity. For example

The link to the Album will be filtered where album.artist = 1. In order to process these URLs in your application, implement ApiSkeletons\Doctrine\QueryBuilder\Filter\Applicator in your controller action:

See the documentation for doctrine-querybuilder-filter for more detailed examples.

Multiple Object Managers

To configure a hydrator for other than the default configuration section, extend the Doctrine Hydrator

Then in your hal-doctrine.php configuration file, create a new section titled secondary and set the entityManager to your second Entity Manager.


All versions of laravel-hal-doctrine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
laravel-doctrine/orm Version ^1.7
api-skeletons/laravel-hal Version ^5.0.2
doctrine/doctrine-laminas-hydrator Version ^2.2
api-skeletons/doctrine-querybuilder-filter Version ^1.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 api-skeletons/laravel-hal-doctrine contains the following files

Loading the files please wait ....