| 1 | <?php namespace App\LaravelRestCms\Page; |
||
| 6 | class PageDetail extends BaseModel { |
||
| 7 | |||
| 8 | public static $searchCols = ['data']; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * The database table used by the model. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $table = 'page_detail'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The attributes that are mass assignable. |
||
| 19 | * |
||
| 20 | * @var array |
||
| 21 | */ |
||
| 22 | protected $fillable = ['page_id', 'template_detail_id', 'data']; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The attributes excluded from the model's JSON form. |
||
| 26 | * |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $hidden = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Rules to validate when creating a model |
||
| 33 | * |
||
| 34 | * @var array |
||
| 35 | */ |
||
| 36 | protected static $createRules = [ |
||
| 37 | 'page_id' => 'integer', |
||
| 38 | 'template_detail_id' => 'integer', |
||
| 39 | 'data' => 'required', |
||
| 40 | ]; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Joins the page_detail table |
||
| 44 | * |
||
| 45 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
| 46 | */ |
||
| 47 | public function templateDetail() |
||
| 51 | |||
| 52 | } |
||
| 53 |