File tree 2 files changed +41
-0
lines changed
2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 7
7
use Illuminate \Support \Facades \Http ;
8
8
use Illuminate \Contracts \Support \Arrayable ;
9
9
use Illuminate \Database \Eloquent \Factories \HasFactory ;
10
+ use Illuminate \Database \Eloquent \Factories \Factory ;
10
11
11
12
use Illuminate \Database \Eloquent \Model ;
12
13
@@ -65,6 +66,14 @@ class IpAddress extends Model
65
66
'proxy ' => 'boolean ' ,
66
67
];
67
68
69
+ /**
70
+ * Create a new factory instance for the model.
71
+ */
72
+ protected static function newFactory (): Factory
73
+ {
74
+ return IpAddressFactory::new ();
75
+ }
76
+
68
77
/**
69
78
* Create a new element.
70
79
*
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace CryptoUnifier \Helpers ;
4
+
5
+ use Illuminate \Database \Eloquent \Factories \Factory ;
6
+
7
+ class IpAddressFactory extends Factory
8
+ {
9
+ /**
10
+ * Define the model's default state.
11
+ *
12
+ * @return array<string, mixed>
13
+ */
14
+ public function definition (): array
15
+ {
16
+ return [
17
+ 'ip_address ' => $ this ->faker ->ipv4 (),
18
+ 'asn ' => $ this ->faker ->randomNumber (4 , true ),
19
+ 'continent ' => 'world ' ,
20
+ 'country ' => $ this ->faker ->country (),
21
+ 'country_code ' => $ this ->faker ->countryCode (),
22
+ 'region ' => $ this ->faker ->state (),
23
+ 'region_code ' => $ this ->faker ->stateAbbr (),
24
+ 'city ' => $ this ->faker ->city (),
25
+ 'latitude ' => $ this ->faker ->latitude (),
26
+ 'longitude ' => $ this ->faker ->longitude (),
27
+ 'risk ' => $ this ->faker ->randomNumber (2 ),
28
+ 'proxy ' => $ this ->faker ->boolean (),
29
+ 'driver ' => 'factory ' ,
30
+ ];
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments