Skip to content

Commit 9362a29

Browse files
authored
[8.x] Guess database factory model by default (#39310)
* Guess database factory model by default * Fixes property `$model` type
1 parent 91270f1 commit 9362a29

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/Illuminate/Database/Console/Factories/stubs/factory.stub

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,9 @@
33
namespace {{ factoryNamespace }};
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use {{ namespacedModel }};
76

87
class {{ factory }}Factory extends Factory
98
{
10-
/**
11-
* The name of the factory's corresponding model.
12-
*
13-
* @var string
14-
*/
15-
protected $model = {{ model }}::class;
16-
179
/**
1810
* Define the model's default state.
1911
*

src/Illuminate/Database/Eloquent/Factories/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class Factory
2424
/**
2525
* The name of the factory's corresponding model.
2626
*
27-
* @var string
27+
* @var string|null
2828
*/
2929
protected $model;
3030

0 commit comments

Comments
 (0)