Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 08e567f

Browse files
committed
feat: update base factory
1 parent 3fe8116 commit 08e567f

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

app/database/factories/Factory.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,19 @@
33
namespace App\Database\Factories;
44

55
use Leaf\Factory as Base;
6-
use Illuminate\Support\Str;
76

87
/**
98
* Base Factory Class
109
* ----------------
1110
* You can define methods here that would be used
1211
* throughout your factory classes.
12+
*
13+
* This is a good place to initialize
14+
* anything you want to use in your factories
15+
*
16+
* We have already initialized faker and the Str for you
17+
* which you can use on $this->faker and $this->str respectively
1318
*/
1419
class Factory extends Base
1520
{
16-
public $str;
17-
18-
/**@var \Faker\Generator $faker*/
19-
public $faker;
20-
21-
public function __construct()
22-
{
23-
// Just for demo purposes, str is assigned here
24-
// so you can use it in all your factories.
25-
$this->str = Str::class;
26-
$this->faker = \Faker\Factory::create();
27-
}
2821
}

0 commit comments

Comments
 (0)