38 lines
660 B
PHP
38 lines
660 B
PHP
<?php
|
|
namespace XaiCorp\AbcParser\Models\Laravel5;
|
|
|
|
class Person extends ValidatingModel
|
|
{
|
|
use UuidTrait;
|
|
|
|
/**
|
|
* The table associated with the model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'persons';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = ['name', 'email'];
|
|
|
|
protected $validationRules = [
|
|
'id' => 'required',
|
|
'name' => 'required|string|max:63',
|
|
'email' => 'required|email|max:255'
|
|
];
|
|
|
|
protected $hidden = ['email'];
|
|
|
|
//Relationships
|
|
|
|
|
|
public function toArray()
|
|
{
|
|
return $this->name;
|
|
}
|
|
}
|