11 changed files with 55 additions and 42 deletions
-
29src/stubs/database/factories/model-factory.stub
-
3src/stubs/models/model-formfield.stub
-
3src/stubs/models/model.stub
-
2src/stubs/routes/web.stub
-
4src/stubs/testcases/browserkit-base-class.stub
-
14src/stubs/testcases/feature/api.stub
-
14src/stubs/testcases/feature/full.stub
-
14src/stubs/testcases/feature/simple.stub
-
4src/stubs/testcases/unit/model-formfield.stub
-
6src/stubs/testcases/unit/model-policy.stub
-
4src/stubs/testcases/unit/model.stub
@ -1,16 +1,23 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
use App\User; |
|
||||
|
namespace Database\Factories; |
||||
|
|
||||
|
use App\Models\User; |
||||
use fullMstr; |
use fullMstr; |
||||
use Faker\Generator as Faker; |
|
||||
|
use Illuminate\Database\Eloquent\Factories\Factory; |
||||
|
|
||||
$factory->define(Master::class, function (Faker $faker) { |
|
||||
|
class MasterFactory extends Factory |
||||
|
{ |
||||
|
protected $model = Master::class; |
||||
|
|
||||
return [ |
|
||||
'name' => $faker->word, |
|
||||
'description' => $faker->sentence, |
|
||||
'creator_id' => function () { |
|
||||
return factory(User::class)->create()->id; |
|
||||
}, |
|
||||
]; |
|
||||
}); |
|
||||
|
public function definition() |
||||
|
{ |
||||
|
return [ |
||||
|
'name' => $this->faker->word, |
||||
|
'description' => $this->faker->sentence, |
||||
|
'creator_id' => function () { |
||||
|
return User::factory()->create()->id; |
||||
|
}, |
||||
|
]; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue