| 1 | <?php |
||
| 33 | class ProjectNamespace extends Model |
||
| 34 | { |
||
| 35 | use ValidatingTrait; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * The attributes that should be casted to native types. |
||
| 39 | * |
||
| 40 | * @var string[] |
||
| 41 | */ |
||
| 42 | protected $casts = [ |
||
| 43 | 'id' => 'int', |
||
| 44 | 'name' => 'string', |
||
| 45 | 'path' => 'string', |
||
| 46 | 'type' => 'string', |
||
| 47 | ]; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * The fillable properties. |
||
| 51 | * |
||
| 52 | * @var string[] |
||
| 53 | */ |
||
| 54 | protected $fillable = ['name', 'path', 'type']; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * The validation rules. |
||
| 58 | * |
||
| 59 | * @var string[] |
||
| 60 | */ |
||
| 61 | public $rules = [ |
||
| 62 | 'name' => 'required|string', |
||
| 63 | 'path' => 'required|string', |
||
| 64 | 'type' => 'string', |
||
| 65 | ]; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * A namespace can have many projects. |
||
| 69 | * |
||
| 70 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
| 71 | */ |
||
| 72 | public function projects() |
||
| 76 | } |
||
| 77 |