-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHouse.php
executable file
·49 lines (41 loc) · 921 Bytes
/
House.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class House extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'houses';
/**
* The database primary key value.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['house_no', 'features', 'rent', 'status', 'water_meter_no', 'electricity_meter_no'];
public function statusOptions(){
return [
'vacant' => 'Vacant',
'occipied' => 'Occupied'
];
}
/**
* Get the tenant that owns the house.
*/
public function tenant()
{
return $this->belongsTo('App\Tenant');
}
public function waterReadings()
{
return $this->hasMany('App\WaterReading');
}
}