Download the PHP package balajidharma/laravel-attributes without Composer
On this page you can find all versions of the php package balajidharma/laravel-attributes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download balajidharma/laravel-attributes
More information about balajidharma/laravel-attributes
Files in balajidharma/laravel-attributes
Package laravel-attributes
Short Description A flexible attribute management system for Laravel models
License MIT
Informations about the package laravel-attributes
Laravel Attributes
A flexible attribute management system for Laravel models.
Overview
Laravel Attributes allows you to add custom attributes to your Laravel models with support for different data types, sorting, and automatic casting.
Table of Contents
- Installation
- Save Attrubute
- Get Attributes
- Getting Attribute Casting Values
- Configuration
- Credits
- Demo
Installation
-
Install the package via composer
-
Publish the migration with
-
Run the migration
-
To Publish the config/attributes.php config file with
- Preparing your model To associate views with a model, the model must implement the HasAttributes trait:
Save attribute
-
Save single attibute
- Save single attibute with data type
default data type is string
- Save single attibute with weight
The weight used to sort the attributes
default weight value is 0
- Save multiple attibute
weight
will be added based on array index
Get Attributes
-
Get attributes with query
-
Check attribute value is exists
-
Check attribute name is exists
- Check attribute data type is exists
Getting Attribute Casting Values
You can get the casting value in data attribute
Delete Attributes
-
Delete all attributes
-
Delete attribute by name and value
-
Delete attribute by name
-
Delete attribute by value
- Delete attribute by data type
Laravel Attributes Configuration
This document describes all configuration options available in the attributes.php
config file.
Configuration Options
Models
Defines the model class used to save attributes. You can override this with your own model class if needed.
Specifies the database table name used for storing attributes. Default is 'attributes'.
Validation
Disable or enable the value validation based on data type.
Data Type and Casting
Support all the Eloquent Attribute Casting
Credits
This package is based on milwad-dev/laravel-attributes and has been modified to provide additional functionality.
Demo
The "Basic Laravel Admin Penel" starter kit come with Laravel Attributes