Download the PHP package vinhnguyen/eloquent-meta without Composer
On this page you can find all versions of the php package vinhnguyen/eloquent-meta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vinhnguyen/eloquent-meta
More information about vinhnguyen/eloquent-meta
Files in vinhnguyen/eloquent-meta
Package eloquent-meta
Short Description Attach meta data to Eloquent models
License MIT
Homepage https://github.com/phoenix-labs/eloquent-meta
Informations about the package eloquent-meta
Phoenix Eloquent Meta
Attach meta data to Laravel's Eloquent models.
- Optionally create a separate table for each Model
- Use with or without Laravel
- Includes Laravel migrations or schema instructions
- Get meta or fallback
Which Version?
- Laravel 5.6 - use
1.8.*
- Laravel 5.5 - use
1.7.*
- Laravel 5.4 - Use
1.6.*
- Laravel 5.3 - Use
1.5.*
- Below 5.3 - Not technically supported, but should work with
.1.3
- Laravel 4 - Also not supported, but should work with
1.2
Stable Version: 1.4. works with Laravel 5. or independently. Pulls Eloquent in automatically.
To use for Laravel 4, see version 1.2.*
Installation
Install through Composer.
Please note only php 5.6
and 7
+ are supported.
If you are using EloquentMeta and Eloquent without using Laravel, you will also have to setup Eloquent as detailed in its documentation.
If you are using Laravel, then you'll want to include the ServiceProvider that will register commands and the like. Update config/app.php
to include a reference to this package's service provider in the providers array.
Table Structure
If you are using Laravel, run the migration php artisan vendor:publish
and php artisan migrate
to create the database table.
If you are not using Laravel then you must create the table manually.
Usage
Add the trait to all models that you want to attach meta data to:
Then use like this:
Unique Meta Models and Tables
You can also define a specific meta model for a meta type. For instance, your User model can use UserMeta model with custom methods and all. Using the example above:
Then in SomeModelMeta simply extends Phoenix\EloquentMeta\Meta. You may now add custom methods to the meta model. You may also dictate which table the metadata is saved to by adding
If you are using EloquentMeta independent of Laravel, then you will have to create the database table manually.
If you are using Laravel, then include the service provider in your config/app.php
Then run to create the migration and run to build the table.
Contributing
Please se [CONTRIBUTING.md] for more information and for testing.
Thank you and Credits
Contributors
- Michael Wilson - @chrismichaels84 - Maintainer
- Paweł Ciesielski - @dzafel
- Lukas Knuth - @LukasKnuth
- @stephandesouza
Many thanks to Boris Glumpler and ScubaClick for the original package!
All versions of eloquent-meta with dependencies
illuminate/support Version 5.4.*|5.5.*|5.6.*|5.7.*|5.8.*
nesbot/carbon Version 1.*
illuminate/database Version 5.4.*|5.5.*|5.6.*|5.7.*|5.8.*
illuminate/validation Version 5.4.*|5.5.*|5.6.*|5.7.*|5.8.*
illuminate/translation Version 5.4.*|5.5.*|5.6.*|5.7.*|5.8.*