program short name
This commit is contained in:
@@ -49,6 +49,7 @@ class ProgramController extends Controller
|
||||
'sub_domain' => ['required', Rule::unique(Program::class, 'sub_domain')],
|
||||
'tahun' => ['required', 'integer'],
|
||||
'instansi' => ['nullable', 'string'],
|
||||
'nama_singkat' => ['required', 'string'],
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
@@ -96,6 +97,7 @@ class ProgramController extends Controller
|
||||
'sub_domain' => ['required', Rule::unique(Program::class, 'sub_domain')->ignore($id)],
|
||||
'tahun' => ['required', 'integer'],
|
||||
'instansi' => ['nullable', 'string'],
|
||||
'nama_singkat' => ['required', 'string'],
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
|
||||
@@ -22,6 +22,7 @@ class ProgramResource extends JsonResource
|
||||
'sub_domain' => $this->sub_domain,
|
||||
'tahun' => $this->tahun,
|
||||
'instansi' => $this->instansi,
|
||||
'nama_singkat' => $this->nama_singkat,
|
||||
'komoditas' => $this->komoditas()->with('komoditas')->get()->map(function ($item) {
|
||||
return new ProgramKomoditasResource($item);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user