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.
Install via composer into your project:
composer require anekdotes/staticmodel
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;