PHPackages                             milwad/laravel-attributes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. milwad/laravel-attributes

ActiveLibrary[Database &amp; ORM](/categories/database)

milwad/laravel-attributes
=========================

Make attributes easy

v1.3.0(1y ago)2276.7k↓47.1%11[1 issues](https://github.com/milwad-dev/laravel-attributes/issues)[1 PRs](https://github.com/milwad-dev/laravel-attributes/pulls)MITPHPPHP ^8.0CI passing

Since Feb 20Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/milwad-dev/laravel-attributes)[ Packagist](https://packagist.org/packages/milwad/laravel-attributes)[ RSS](/packages/milwad-laravel-attributes/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (23)Used By (0)

Laravel Attributes
==================

[](#laravel-attributes)

[![Laravel-Attributes](https://camo.githubusercontent.com/68aab04ad26ce895c12afb48fd12613717362d0c7578404572b6e26e35d610f9/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230417474726962757465732e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d696c7761642532466c61726176656c2d61747472696275746573267061747465726e3d626f786573267374796c653d7374796c655f32266465736372697074696f6e3d4d616b652b617474726962757465732b656173792b666f722b4c61726176656c266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/68aab04ad26ce895c12afb48fd12613717362d0c7578404572b6e26e35d610f9/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c253230417474726962757465732e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d6d696c7761642532466c61726176656c2d61747472696275746573267061747465726e3d626f786573267374796c653d7374796c655f32266465736372697074696f6e3d4d616b652b617474726962757465732b656173792b666f722b4c61726176656c266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Latest Stable Version](https://camo.githubusercontent.com/7f675e8235bc8a2991263d9ff1e93670f01926927d13c1141d79707f24fa1cdd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c7761642f6c61726176656c2d617474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/milwad/laravel-attributes)[![Total Downloads](https://camo.githubusercontent.com/dc319bbeb4d62263a7df6b831580763852300fc04ee3099163e48a774fd8988c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696c7761642f6c61726176656c2d617474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/milwad/laravel-attributes)[![License](https://camo.githubusercontent.com/2e52a9e620090199a4094a09dd4a654a66256a847d0e7dc02e0dc0a012fe7815/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d696c7761642f6c61726176656c2d61747472696275746573)](https://packagist.org/packages/milwad/laravel-attributes)[![Passed Tests](https://github.com/milwad-dev/laravel-attributes/actions/workflows/run-tests.yml/badge.svg)](https://github.com/milwad-dev/laravel-attributes/actions/workflows/run-tests.yml)[![PHP Version Require](https://camo.githubusercontent.com/5706cece4238d30efc708e5a368cc04ed9d4d78817d91a18a1585f67cbdad76b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6d696c7761642f6c61726176656c2d617474726962757465732f706870)](https://packagist.org/packages/milwad/laravel-attributes)

---

The `laravel-attributes` package is a tool designed to help Laravel developers easily manage and implement custom attributes in their projects. It enables you to define attributes directly on Eloquent models, making it simpler to handle dynamic or calculated properties without directly modifying the database schema. With this package, you can create and configure attribute sets for models, making it easier to organize and extend data handling in Laravel applications. It's especially useful for projects that require customizable and flexible data models.
You don't have any stress for attributes! You can create attributes for any model and display like drink water :)

Requirements
============

[](#requirements)

---

- `PHP: ^8.0`
- `Laravel Framework: ^9.0`

AttributesL9L10L11L121.0✅✅❌❌1.1✅✅❌❌1.2✅✅✅❌1.3✅✅✅✅Installation
============

[](#installation)

---

```
composer require milwad/laravel-attributes

```

After publish config files.

```
php artisan vendor:publish --provider="Milwad\LaravelAttributes\LaravelAttributesServiceProvider"
```

After publish, you migrate the migration file.

```
php artisan migrate

```

Usage
=====

[](#usage)

First, you use trait in model.

```
