tonning / metabox
Create metaboxes for AdminLTE admin panel
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tonning/metabox
Requires
- laravelcollective/html: ^5.1
This package is not auto-updated.
Last update: 2022-02-01 12:48:59 UTC
README
Installation
First, pull in the package through Composer.
"require": { "tonning/metabox": "~0.1" }
And then, if using Laravel 5.1, include the service provider within app/config/app.php
.
'providers' => [ Tonning\Metabox\MetaboxServiceProvider::class ];
And, for convenience, add a facade alias to this same file at the bottom:
'aliases' => [ 'Metabox' => Tonning\Metabox\MetaboxFacade::class ];
On Eloquent models that uses metaboxes add
/** * Serialize the meta data on persist * * @param $meta */ public function setMetaAttribute($meta) { $this->attributes['meta'] = serialize($meta); } /** * Unserialize the meta data on retrival * * @param $meta * @return mixed */ public function getMetaAttribute($meta) { return unserialize($meta); }