| Package Data | |
|---|---|
| Maintainer Username: | marksihor |
| Maintainer Contact: | marks.ihor@gmail.com (Ihor Korotkyi) |
| Package Create Date: | 2020-06-09 |
| Package Last Update: | 2023-03-08 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-20 15:07:17 |
| Package Statistics | |
|---|---|
| Total Downloads: | 5,984 |
| Monthly Downloads: | 7 |
| Daily Downloads: | 3 |
| Total Stars: | 0 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
Laravel metas package.
$ composer require marksihor/laravel-metas -vvv
This step is optional, if you want to customize the tables, you can publish the migration files:
$ php artisan vendor:publish --provider="MarksIhor\\LaravelMetas\\MetasServiceProvider" --tag=migrations
MarksIhor\LaravelMetas\Metable<?php
namespace App\User;
<...>
use MarksIhor\LaravelMetas\Metable;
class User extends Authenticatable
{
<...>
use Metable;
<...>
}
$user()->getMetas();
$user()->getMeta('key');
$user()->setMeta('key', 'value');
$user()->unsetMeta('key');
If you modified metas table and want to use some extra logic, you can pass additional credentials.
$user()->getMetas(['site_id' => 1]);
$user()->getMeta('key', ['site_id' => 1]);
$user()->setMeta('key', 'value', ['site_id' => 1]);
$user()->unsetMeta('key', ['site_id' => 1]);
MIT