Download the PHP package brahmic/laravel-filler without Composer

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

Laravel Eloquent Database Filler

Latest Version on Packagist GitHub Tests Action Status

Concept

When working with data via the API, we often receive these entities with nested relationships, but when sending data, the nested relationships have to be processed manually. This hydration pack allows you not to think about it. And this greatly speeds up development.

Peculiarities

Content

Restrictions

Currently only works with uuid

Installation

Usage

This thing is very easy to use

πŸ‘†

Backend example

πŸ‘†

Frontend example

(don't do this - this is just an example)

πŸ‘†

Input features

Flat entities

Let's take a simple example:

Since the passed data does not contain the id field (or another field that was specified in the $primaryKey model), the hydrator will create a new entity. And fill it with the transferred data using the standard fill method. In this case, an id will be immediately generated for the model.

Example with ID:

In this example, id was passed - so the hydrator will try to find such an entity in the database. However, if it fails to find such a record in the database, it will create a new entity with the passed id . In any case, the hydrator will fill this model with the passed email and name. In this case, the behavior is similar to User::findORNew($id).

πŸ‘†

HasOne

In this case, the hydrator will deal with the first-level entity (user) in the same way as in the example with the identifier. Then, it will try to find the account - if it does not find it (and in the current example the account does not have an id), it will create a new one. If it finds one with a different identifier, it will replace it with the newly created one. The old account will be deleted. Of course, in any post field (for example user_id or author_id - depending on how it is specified in relation to User::account()), the user ID will be written.

πŸ‘†

HasMany

In the many-to-one example, a hydrator would come with each post entry, as in the HasOne example. In addition, all posts that were not present in the passed array of posts will be deleted.

πŸ‘†

BelongsTo

Although this example looks like HasOne, it works differently. If such an organization is found by the hydrator in the database, the user will be linked to it through the relationship field. On the other hand, if there is no such record, the user will receive null in this field. All other fields of the associated record (organization) will be ignored - since User is not the aggregate root of Organization, therefore it is not possible to manipulate organization fields through the user object, nor is it possible to create new organizations.

πŸ‘†

BelongsToMany

This example is like a mixture of HasMany (in the sense that all non-represented records will be removed from the pivot) and BlongsTo (all fields except the $primaryKey field will be ignored, for the reasons explained above in the belongsTo section) . Please note that working with a pivot is also available.

MorphTo

Supported, but not yet described. The principle of operation is similar to that described above.

MorphOne

Supported, but not yet described. The principle of operation is similar to that described above.

MorphMany

Supported, but not yet described. The principle of operation is similar to that described above.


Everything described works recursively, and is valid for any degree of nesting.


πŸ‘†

Output Features

It's also worth noting that all passed relationships will be added to the entity during output. For example:

πŸ‘†

TODO

πŸ‘†


All versions of laravel-filler with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
ramsey/uuid Version ^4.1.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 brahmic/laravel-filler contains the following files

Loading the files please wait ....