-
Notifications
You must be signed in to change notification settings - Fork 4
/
Tahun.php
68 lines (56 loc) · 1.89 KB
/
Tahun.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Tahun extends Model
{
protected $table = 'tahun';
// public $incrementing = false;
public $timestamps = true;
// protected $guarded = ['id', 'account_id'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable =[
'tahun',
'default'
];
public $kolom=[
// 'A'=>'tahun',
// 'R'=>'realisasi_bulan_12'
];
// private $rules = array(
// /*Sebenarnyaaa ==============================================================*/
// 'A'=> 'required|numeric|digits:4',
// 'B'=> 'required|numeric|digits:4',
// 'C'=> 'required|numeric|digits_between:1,5',
// 'D'=> 'required|numeric|digits_between:1,5',
// 'E'=> 'required|numeric|digits_between:1,5',
// 'F'=> 'required|numeric|digits_between:1,5',
// 'G'=>'required|numeric|digits_between:1,20',
// 'H'=>'required|numeric|digits_between:1,20',
// 'I'=>'required|numeric|digits_between:1,20',
// 'J'=>'required|numeric|digits_between:1,20',
// 'K'=>'required|numeric|digits_between:1,20',
// 'L'=>'required|numeric|digits_between:1,20',
// 'M'=>'required|numeric|digits_between:1,20',
// 'N'=>'required|numeric|digits_between:1,20',
// 'O'=>'required|numeric|digits_between:1,20',
// 'P'=>'required|numeric|digits_between:1,20',
// 'Q'=>'required|numeric|digits_between:1,20',
// 'R'=>'required|numeric|digits_between:1,20'
// );
public function validate($data)
{
// make a new validator object
$v = \Validator::make($data, $this->rules);
// return the result
return $v;
// return $v->passes();
}
public function liburs()
{
return $this->hasMany('App\Libur','tahun_id');
}
}