Download the PHP package skraeda/laravel-automapper without Composer

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

Laravel AutoMapper

CircleCI Codecov Version Badge License Badge

This package integrates AutoMapper+ by Mark Gerarts into Laravel.

This documentation will assume you are familiar with how AutoMapper+ works.

Installation

Install via composer:

AutoMapping

For this example, we want to be able to easily map between Employee and EmployeeDto models.

Example models

Registering the mappings

We can register the mappings in our boot method in any ServiceProvider

Mapping between the models

Using the facade or alias

Using the contract

Using the helper functions

Custom Mappers

AutoMapper+ allows us to define separate classes to perform the mapping if it requires more complicated logic or if we need better performance.

Let's change EmployeeDto to look like this instead

To teach the AutoMapper+ how to use a custom mapper to map to the new EmployeeDto model then delete the old mapping and create a new custom mapper.

You can manually register this custom mapping in your ServiceProvider or you can use a mapping.php config file.

Publish the config file

Register custom mappers

Starting with Version 2, you can have Custom Mappers automatically discovered by enabling directory scanning in the mapping.php config file. Mappers found within the directories you specify in mapping.php with the Maps attribute will be automatically registered.

If you have multiple mappers discovered this way, you may want to turn on caching for your production environment within the mapping.php config file. With caching enabled, the first request will scan your files for mappers and store them in a cache file (default: app_dir/storage/app/framework/automapper/automapper.php) that's loaded for the next requests.

You can use php artisan mapping:clear to clear the mapping cache directory if you add new mappers.

You can also use php artisan mapping:cache to immediately scan and cache the mappers.

Helpers and methods

Collection macro

You can use the autoMap method on a collection to map into some target class.

Generator command

You can use the make:mapper artisan command to generate the boilercode for a custom mapper.

AutoMapperContract

AutoMapperFacade

Helper functions

Testing

Run

Alternatively

Generate coverage

Alternatively

Run static analysis

Alternatively

Changelog

V2.0.0

v1.2.0

V1.1.0


All versions of laravel-automapper with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
illuminate/support Version ~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/console Version ~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0
mark-gerarts/auto-mapper-plus Version v2.0.0-alpha1
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 skraeda/laravel-automapper contains the following files

Loading the files please wait ....