write test for azmayesh type entity
This commit is contained in:
@@ -46,9 +46,7 @@ class AzmayeshTypeController extends Controller
|
||||
|
||||
public function fields(AzmayeshType $azmayeshType): JsonResponse
|
||||
{
|
||||
$fields = $azmayeshType->azmayeshFields->select('id', 'name', 'unit', 'type', 'option');
|
||||
|
||||
return $this->successResponse($fields);
|
||||
return $this->successResponse($azmayeshType->azmayeshFields);
|
||||
}
|
||||
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
|
||||
@@ -12,6 +12,7 @@ class AzmayeshField extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
protected $hidden = ['pivot'];
|
||||
|
||||
protected function option(): Attribute
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ class AzmayeshType extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
protected $hidden = ['pivot'];
|
||||
|
||||
public function azmayeshes(): HasMany
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user