Download the PHP package jlopezcur/metable without Composer

On this page you can find all versions of the php package jlopezcur/metable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package metable

Metable

A Laravel trait to access model meta data as if it was a property on your model (Fork based on the work of https://github.com/Azirius/hasmeta) for Laravel 5

Installation

Run composer require jlopezcur/metable 0.1.* or add "jlopezcur/metable": "0.1.*" to your composer.json file

In the Model that you want to utilise Metable add the following properties

Real World Example

Nothing like a simple example to explain things

Setup

users table

id email password
1 [email protected] ADpQeKh$2y$10$0dh/BerzTrEOBhu4SR3w05
2 [email protected] pQeKhrzTrEOBhu$2y$10$0dh/BeAD4SR3w05
3 [email protected] ADpQeKhrzTrEOBhu4SR3w05$2y$10$0dh/Be
4 [email protected] BeADpQeKhrzTrEO$2y$10$0dh/Bhu4SR3w05
5 [email protected] DpQeKhrzTrEOBhu4SR3w05$2y$10$0dh/BeA

users_meta table

id user_id meta_name meta_value
1 1 first_name John
2 1 surname Roberts
3 1 age 20
4 1 gender Male
5 2 first_name Steven
6 2 surname Watson
7 2 age 35
8 2 gender Male
9 3 first_name Sam
10 3 surname Faddy
11 3 age 30
12 3 gender Female
13 4 first_name Ben
14 4 surname Prokop
15 4 age 32
16 4 gender Male
17 5 first_name Jo
18 5 surname Blair
19 5 age 31
20 5 gender Female

User.php model

UserMeta.php model

Usage

Now we can simply do this for getting meta data...

We can save meta data easily too...

Delete meta...

New meta...

Mass assignment...

For mass assignment Remember add in your model...


All versions of metable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version ~5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jlopezcur/metable contains the following files

Loading the files please wait ....