Download the PHP package trappistes/laravel-custom-fields without Composer

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

Laravel Custom Fields

A flexible EAV (Entity-Attribute-Value) package for Laravel Eloquent models, allowing dynamic custom fields without modifying the database schema.

🇺🇸 English

Features

Installation

Publishing Configuration

Configuration

Run Migrations

Quick Start

1. Use Trait in Model

2. Set Custom Fields

3. Get Custom Fields

4. Preload Custom Fields

Supported Field Types

Type PHP Type Storage Format Example
string string raw string "Hello World"
bigint int numeric string "9223372036854775807"
float float numeric string "3.14159"
bool bool "1" or "0" "1"
json array/object JSON string '{"key":"value"}'
date Carbon/string Y-m-d "2024-01-15"
time Carbon/string H:i:s "14:30:00"
datetime Carbon/string Y-m-d H:i:s "2024-01-15 14:30:00"
daterange CarbonPeriod/DatePeriod JSON '{"start":"2024-01-01","end":"2024-01-31"}'

Types are automatically inferred:

Field Naming Rules

Mass Assignment

Soft Deletes

When the main model uses soft deletes, custom fields are preserved on normal delete and deleted on force delete:

UUID / ULID Support

By default, the id primary key and model_id column use unsignedBigInteger. To support UUID or ULID:

Option 1: Use UUID

  1. Modify the migration to use uuid() for the primary key and model_id:

  2. Create a custom model with the HasUuids trait:

Option 2: Use ULID

  1. Modify the migration to use ulid() for the primary key and model_id:

  2. Create a custom model with the HasUlids trait:

Apply the Custom Model

Update your config to use the custom model:

Database Schema

Compatibility

Laravel PHP Status
9.x 8.1+ Supported
10.x 8.1+ Supported
11.x 8.2+ Supported
12.x 8.2+ Supported

Testing

License

MIT License


All versions of laravel-custom-fields with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^9.0|^10.0|^11.0|^12.0|^13.0
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 trappistes/laravel-custom-fields contains the following files

Loading the files please wait ...