Skip to content

Abstract class used to create static Model classes. These classes have their data initiated in themselves. Allows Model operations to be used to a certain extent.

License

Notifications You must be signed in to change notification settings

anekdotes/staticmodel

Repository files navigation

Anekdotes Staticmodel

Latest Stable Version Build Status codecov.io StyleCI License Total Downloads Codacy Badge

Abstract class used to create static Model classes. These classes have their data initiated in themselves. Allows Model operations to be used to a certain extent.

Installation

Install via composer into your project:

composer require anekdotes/staticmodel

Usage

Create your static class by inheriting StaticModel. Fill it with your static data.

class Languages extends StaticModel {

  public static $data = array(
    array(                 
      'id' => 1,           
      'name' => 'English',
      'small' => 'en' 
    )
  );
      
}       

You can then call the model as any other Illuminate model, and use most of Illuminate's functionalities.

$english = Languages::find(1);
$englishname = $english->name;

About

Abstract class used to create static Model classes. These classes have their data initiated in themselves. Allows Model operations to be used to a certain extent.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages