Download the PHP package diego-ninja/granite without Composer

On this page you can find all versions of the php package diego-ninja/granite. 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 granite

๐Ÿชจ Granite

Latest Version on Packagist Total Downloads PHP Version License: MIT GitHub last commit wakatime

A powerful, zero-dependency PHP library for building immutable, serializable objects with validation and mapping capabilities. Perfect for DTOs, Value Objects, API responses, and domain modeling.

This documentation has been generated almost in its entirety using ๐Ÿฆ  Claude 4 Sonnet based on source code analysis. Some sections may be incomplete, outdated or may contain documentation for planned or not-released features. For the most accurate information, please refer to the source code or open an issue on the package repository.

โœจ Features

๐Ÿ”’ Immutable Objects

โœ… Comprehensive Validation

๐Ÿ”„ Powerful ObjectMapper

๐Ÿ“ฆ Smart Serialization

โšก Performance Optimized

๐Ÿš€ Quick Start

Installation

Basic Usage

๐Ÿ“– Documentation

Core Concepts

Guides

๐ŸŽฏ Use Cases

API Development

Domain Modeling

Object Mapping with ObjectMapper

๐Ÿ”ฅ Advanced Features

Convention-Based Mapping

Advanced ObjectMapper Configuration

Custom Mapping Profiles

Complex Validation

Global ObjectMapper Configuration

๐Ÿ›  Validation Rules

Built-in Rules

Rule Description Example
#[Required] Field must not be null #[Required('Name is required')]
#[Email] Valid email format #[Email('Invalid email')]
#[Min(5)] Minimum length/value #[Min(5, 'Too short')]
#[Max(100)] Maximum length/value #[Max(100, 'Too long')]
#[Regex('/pattern/')] Regular expression #[Regex('/^\d+$/', 'Numbers only')]
#[In(['a', 'b'])] Value in list #[In(['active', 'inactive'])]
#[Url] Valid URL format #[Url('Invalid URL')]
#[IpAddress] Valid IP address #[IpAddress('Invalid IP')]
#[StringType] Must be string #[StringType]
#[IntegerType] Must be integer #[IntegerType]
#[NumberType] Must be number #[NumberType]
#[BooleanType] Must be boolean #[BooleanType]
#[ArrayType] Must be array #[ArrayType]
#[EnumType] Valid enum value #[EnumType(Status::class)]
#[Each(...)] Validate array items #[Each(new Email())]
#[When(...)] Conditional validation #[When($condition, $rule)]

๐Ÿ“ˆ Performance

Granite is optimized for performance with:

๐Ÿงช Testing

Granite objects are perfect for testing due to their immutability and validation:

๐Ÿ”ง Requirements

๐Ÿ“ฆ Installation & Setup

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license.

๐Ÿ™ Credits

This project is developed and maintained by ๐Ÿฅท Diego Rin in his free time.

If you find this project useful, please consider:


Made with โค๏ธ for the PHP community


All versions of granite with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4
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 diego-ninja/granite contains the following files

Loading the files please wait ....