Download the PHP package nelkasovic/laravel-metable without Composer
On this page you can find all versions of the php package nelkasovic/laravel-metable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nelkasovic/laravel-metable
More information about nelkasovic/laravel-metable
Files in nelkasovic/laravel-metable
Package laravel-metable
Short Description A package for attaching arbitrary data to Eloquent models
License MIT
Informations about the package laravel-metable
Laravel-Metable
Laravel-Metable is a package for easily attaching arbitrary data to Eloquent models.
Features
- One-to-many polymorphic relationship allows attaching data to Eloquent models without needing to adjust the database schema.
- Type conversion system allows data of numerous different scalar and object types to be stored and retrieved. See the documentation for the list of supported types.
Example Usage
Attach some metadata to an eloquent model
Query the model by its metadata
Retrieve the metadata from a model
Installation
-
Add the package to your Laravel app using composer
-
Register the package's service provider in
config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled. -
Publish the config file (
config/metable.php
) of the package using artisan. -
Run the migrations to add the required table to your database.
- Add the
Plank\Metable\Metable
trait to any eloquent model class that you want to be able to attach metadata to.
Note: If need a more generic way to reference different Metable Model classes, you can optionally apply the Plank\Metable\MetableInterface
to your models.
Documentation
The full documentation is available on ReadTheDocs.
License
This package is released under the MIT license (MIT).
About Plank
Plank is a web development agency based in Montreal, Canada.