File tree Expand file tree Collapse file tree 4 files changed +52
-10
lines changed Expand file tree Collapse file tree 4 files changed +52
-10
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Tipoff \GoogleApi \Database \Factories ;
6
+
7
+ use Illuminate \Database \Eloquent \Factories \Factory ;
8
+ use Tipoff \GoogleApi \Models \GmbAccount ;
9
+
10
+ class GmbAccountFactory extends Factory
11
+ {
12
+ protected $ model = GmbAccount::class;
13
+
14
+ public function definition ()
15
+ {
16
+ return [
17
+ 'account_number ' => $ this ->faker ->unique ()->slug ,
18
+ 'key_id ' => randomOrCreate (app ('key ' )),
19
+ 'creator_id ' => randomOrCreate (app ('user ' )),
20
+ 'updater_id ' => randomOrCreate (app ('user ' )),
21
+ ];
22
+ }
23
+ }
Original file line number Diff line number Diff line change 9
9
10
10
class KeyFactory extends Factory
11
11
{
12
- /**
13
- * The name of the factory's corresponding model.
14
- *
15
- * @var string
16
- */
17
12
protected $ model = Key::class;
18
13
19
- /**
20
- * Define the model's default state.
21
- *
22
- * @return array
23
- */
24
14
public function definition ()
25
15
{
26
16
return [
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Tipoff \GoogleApi \Models ;
6
+
7
+ use Tipoff \Support \Models \BaseModel ;
8
+ use Tipoff \Support \Traits \HasCreator ;
9
+ use Tipoff \Support \Traits \HasPackageFactory ;
10
+ use Tipoff \Support \Traits \HasUpdater ;
11
+
12
+ class GmbAccount extends BaseModel
13
+ {
14
+ use HasCreator;
15
+ use HasUpdater;
16
+ use HasPackageFactory;
17
+
18
+ protected $ casts = [];
19
+
20
+ public function key ()
21
+ {
22
+ return $ this ->belongsTo (app ('key ' ));
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -12,4 +12,9 @@ class Key extends BaseModel
12
12
use HasPackageFactory;
13
13
14
14
protected $ casts = [];
15
+
16
+ public function gmb_accounts ()
17
+ {
18
+ return $ this ->hasMany (app ('gmb_account ' ));
19
+ }
15
20
}
You can’t perform that action at this time.
0 commit comments