Skip to content
ordent edited this page Dec 14, 2016 · 1 revision

Model

In order to access the full potential of Ramen Model, you need to do one of the following.

  • Extend from Ordent\Ramenplatform\Resources\Model\ResourceModel

    class ObjectModel extends ResourceModel

  • Or if you somehow cannot the extend the model, you can implement the Ordent\Ramenplatform\Contracts\Model\ResourceModelInterface and use the Ordent\Ramenplatform\Resources\Traits\ResourceModelTrait

Configuration

/**
 * attributes of a model
 * @var array of attributes name on string
 */
protected $attributes = [];
/**
 * casting of a attributes to native types, useful for native types, like integer, boolean, JsonSerializable
 * @var ["attributes"=>"type"]
 */
protected $casts = [];
/**
 * casting of a date attributes
 * @var ["attributes1", "attributes2"]
 */
protected $dates = [];
/**
 * original state of an attributes
 * @var ["isActive" => 1]
 */
protected $original = [];
/**
 * set the transformer file of the model
 * @var string
 */
protected $transformers = "";
/**
 * set the rules of an attributes
 * @var [type]
 */
protected $rules = [
    "store" => [],
    "update" => [],
    "delete" => []
];
/**
 * list of scope to be used as filter for index operation
 * @var array
 */
protected $indexFilters = ['pagination', 'sort'];
/*
* list of attribute that have files type.
*/
protected $files = [];
protected $uploadPath = "uploads";
Clone this wiki locally