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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle