| 1 | <?php |
||
| 7 | class Device extends Model |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The table associated with the model. |
||
| 11 | * |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $table = 'devices'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The primary key column name. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $primaryKey = 'device_id'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Indicates if the model should be timestamped. |
||
| 25 | * |
||
| 26 | * @var bool |
||
| 27 | */ |
||
| 28 | public $timestamps = false; |
||
| 29 | |||
| 30 | public function getIpAttribute($ip) |
||
| 36 | |||
| 37 | public function setIpAttribute($ip) |
||
| 41 | |||
| 42 | // ---- Define Reletionships ---- |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Returns a list of users that can access this device. |
||
| 46 | */ |
||
| 47 | public function users() { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Returns a list of the ports this device has. |
||
| 53 | */ |
||
| 54 | public function ports() { |
||
| 57 | |||
| 58 | } |
||
| 59 |