Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laralight Metadata Laravel Package

seyedmr/laralight-metadata

View on GitHub
Deep Wiki
Context7

Laralight Metadata

laralight-metadata package created for those projects need to have metadata. i named this to laralight because this package is so light and also created for 'lara'vel.

i created a lot light package for laravel and i'll add them to my git soon.

Installing

  1. composer require seyedmr/laralight-metadata
  2. php artisan migrate

Congrat , you done it.

Usage

as i said before , this package is too light and easy to use.

Prepare your model

Add this trait to the model that you want that to have metadata.

SeyedMR\LaraliteMetadata\Traits\HasMeta

For example (User):

namespace App;

...
use Illuminate\Database\Eloquent\Model;
use SeyedMR\LaraliteMetadata\Traits\HasMeta;

class User extends Model
{
    use HasMeta;
    
    ...
}

And now your model is ready to have metadata.

Adding metadata

for adding metadata you just need to use this method. $model->setMeta('meta-key','meta-value');

For example :

$user = User::find(1);
$user->setMeta('meta-key','meta-value');

Getting metadata

Getting metadata is easy too.

For example :

$user = User::find(1);
$user->getMeta('meta-key');
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity