File tree Expand file tree Collapse file tree 7 files changed +115
-0
lines changed
Expand file tree Collapse file tree 7 files changed +115
-0
lines changed Original file line number Diff line number Diff line change 66
77class County extends Model
88{
9+
10+ private $ format ;
11+
12+ public function __construct ()
13+ {
14+ parent ::__construct ();
15+ $ this ->format = config ('uglocale.date_format ' , 'd M Y, h:i A ' );
16+ }
17+
918 protected $ fillable = ['name ' , 'district_id ' ];
1019
1120 public function district ()
@@ -17,4 +26,14 @@ public function subCounties()
1726 {
1827 return $ this ->hasMany (SubCounty::class);
1928 }
29+
30+ public function getCreatedAtAttribute ()
31+ {
32+ return \Carbon \Carbon::parse ($ this ->attributes ['created_at ' ])->format ($ this ->format );
33+ }
34+
35+ public function getUpdatedAtAttribute ()
36+ {
37+ return \Carbon \Carbon::parse ($ this ->attributes ['updated_at ' ])->format ($ this ->format );
38+ }
2039}
Original file line number Diff line number Diff line change 66
77class District extends Model
88{
9+
10+ private $ format ;
11+
12+ public function __construct ()
13+ {
14+ parent ::__construct ();
15+ $ this ->format = config ('uglocale.date_format ' , 'd M Y, h:i A ' );
16+ }
17+
918 protected $ fillable = ['name ' ,'region_id ' ];
1019
1120 public function region ()
@@ -17,4 +26,14 @@ public function counties()
1726 {
1827 return $ this ->hasMany (County::class);
1928 }
29+
30+ public function getCreatedAtAttribute ()
31+ {
32+ return \Carbon \Carbon::parse ($ this ->attributes ['created_at ' ])->format ($ this ->format );
33+ }
34+
35+ public function getUpdatedAtAttribute ()
36+ {
37+ return \Carbon \Carbon::parse ($ this ->attributes ['updated_at ' ])->format ($ this ->format );
38+ }
2039}
Original file line number Diff line number Diff line change 66
77class Parish extends Model
88{
9+
10+ private $ format ;
11+
12+ public function __construct ()
13+ {
14+ parent ::__construct ();
15+ $ this ->format = config ('uglocale.date_format ' , 'd M Y, h:i A ' );
16+ }
17+
918 protected $ fillable = ['name ' , 'sub_county_id ' ];
1019
1120 public function subCounty ()
@@ -17,4 +26,14 @@ public function villages()
1726 {
1827 return $ this ->hasMany (Village::class);
1928 }
29+
30+ public function getCreatedAtAttribute ()
31+ {
32+ return \Carbon \Carbon::parse ($ this ->attributes ['created_at ' ])->format ($ this ->format );
33+ }
34+
35+ public function getUpdatedAtAttribute ()
36+ {
37+ return \Carbon \Carbon::parse ($ this ->attributes ['updated_at ' ])->format ($ this ->format );
38+ }
2039}
Original file line number Diff line number Diff line change 66
77class Region extends Model
88{
9+
10+ private $ format ;
11+
12+ public function __construct ()
13+ {
14+ parent ::__construct ();
15+ $ this ->format = config ('uglocale.date_format ' , 'd M Y, h:i A ' );
16+ }
917
1018 protected $ fillable = ['name ' ];
1119
1220 public function districts ()
1321 {
1422 return $ this ->hasMany (District::class);
1523 }
24+
25+ public function getCreatedAtAttribute ()
26+ {
27+ return \Carbon \Carbon::parse ($ this ->attributes ['created_at ' ])->format ($ this ->format );
28+ }
29+
30+ public function getUpdatedAtAttribute ()
31+ {
32+ return \Carbon \Carbon::parse ($ this ->attributes ['updated_at ' ])->format ($ this ->format );
33+ }
1634}
Original file line number Diff line number Diff line change 66
77class SubCounty extends Model
88{
9+
10+ private $ format ;
11+
12+ public function __construct ()
13+ {
14+ parent ::__construct ();
15+ $ this ->format = config ('uglocale.date_format ' , 'd M Y, h:i A ' );
16+ }
17+
918 protected $ fillable = ['name ' , 'county_id ' ];
1019
1120 public function county ()
@@ -17,4 +26,14 @@ public function parishes()
1726 {
1827 return $ this ->hasMany (Parish::class);
1928 }
29+
30+ public function getCreatedAtAttribute ()
31+ {
32+ return \Carbon \Carbon::parse ($ this ->attributes ['created_at ' ])->format ($ this ->format );
33+ }
34+
35+ public function getUpdatedAtAttribute ()
36+ {
37+ return \Carbon \Carbon::parse ($ this ->attributes ['updated_at ' ])->format ($ this ->format );
38+ }
2039}
Original file line number Diff line number Diff line change 66
77class Village extends Model
88{
9+
10+ private $ format ;
11+
12+ public function __construct ()
13+ {
14+ parent ::__construct ();
15+ $ this ->format = config ('uglocale.date_format ' , 'd M Y, h:i A ' );
16+ }
17+
918 protected $ fillable = ['name ' , 'parish_id ' ];
1019
1120 public function parish ()
1221 {
1322 return $ this ->belongsTo (Parish::class);
1423 }
24+
25+ public function getCreatedAtAttribute ()
26+ {
27+ return \Carbon \Carbon::parse ($ this ->attributes ['created_at ' ])->format ($ this ->format );
28+ }
29+
30+ public function getUpdatedAtAttribute ()
31+ {
32+ return \Carbon \Carbon::parse ($ this ->attributes ['updated_at ' ])->format ($ this ->format );
33+ }
1534}
35+
Original file line number Diff line number Diff line change 22
33return [
44 'batch_size ' => env ('UGLOCALE_BATCH_SIZE ' , 1000 ),
5+ 'date_format ' => 'd M Y, h:i A '
56];
You can’t perform that action at this time.
0 commit comments