railken / amethyst-common
Installs: 13 042
Dependents: 5
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=8.1
- doctrine/inflector: ^2.0
- laravel/framework: 9.* | 10.*
- laravel/helpers: ^1.2
- league/fractal: ^0.17.0
- railken/bag: ^2.0
- railken/cacheable: 0.2.*
- railken/eloquent-instance: ^2.0
- railken/eloquent-mapper: 0.4.*
- railken/lem: ^4.0
Requires (Dev)
- dev-master
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.17
- v0.2.16
- v0.2.15
- v0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.50
- v0.1.49
- v0.1.47
- v0.1.46
- v0.1.45
- v0.1.44
- v0.1.43
- v0.1.42
- v0.1.41
- v0.1.40
- v0.1.39
- v0.1.38
- v0.1.37
- v0.1.36
- v0.1.35
- v0.1.34
- v0.1.33
- v0.1.32
- v0.1.31
- v0.1.30
- v0.1.29
- v0.1.28
- v0.1.27
- v0.1.26
- v0.1.25
- v0.1.24
- v0.1.23
- v0.1.22
- v0.1.21
- v0.1.20
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2024-10-28 18:39:24 UTC
README
This is the core of all Amethyst packages.
Requirements
- PHP from 8.1
Installation
You can install it via Composer by typing the following command:
composer require amethyst/core
The package will automatically register itself.
Mapping the hell out of it
Amethyst takes a lot of advantages by mapping all models, relations and attributes; it does soo much that it's a requirement for every package:
- Each instance of Model must be converted in a readable string (e.g. classname, or morph name) and viceversa.
- Given an instance of Model it should be possible to retrieve all relations.
- Given an instance of Model it should be possibile to retrieve all attributes.
Note: It's important to notice that we are refering to an instance of Model instead of class of Model.
What are the benefits then?
Because having this kind of information will make a lot of things easy (for e.g. auto joins, creating views)
How it's done and how extend it
All amethyst packages are automatically mapped, that's because the mapping use the configuration under amethyst
to retrieve all models
This is done by using the package eloquent-mapper.
How interact with the data
There are two ways to interact with the data: Through code or with http calls
Code
Http calls
Each data has the following operation: - 'Create a new record' - 'Retrieve a single record' - 'Update a single ecord' - 'Delete a single record' - 'Show multiple records' - 'Remove multiple records' - 'Update multiple records'
How customize the data
One of the key package used to handle data is lem. This package provide a way to define a schema, validate, authorize, serialize and handle errors; all of this incapsulated by a class, called the Manager
.
https://github.com/amethyst-php/cli
Testing
- Clone this repository
- Copy the default
phpunit.xml.dist
tophpunit.xml
- Change the environment variables as you see fit
- Launch
./vendor/bin/phpunit