add static azmayesh fields

This commit is contained in:
2024-10-23 15:54:01 +03:30
parent c2ceb3d343
commit e9098b0a55
12 changed files with 137 additions and 18 deletions

View File

@@ -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']),
];
}
}