add static azmayesh fields
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Azmayesh;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,11 @@ class AzmayeshSampleFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
'azmayesh_id' => Azmayesh::factory(),
|
||||
'azmayesh_name' => function (array $attributes) {
|
||||
return Azmayesh::query()->find($attributes['azmayesh_id'])->name;
|
||||
},
|
||||
'data' => json_encode(['test']),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user