get(); return RequirementGroupResource::collection($groups); } /** * Store a newly created resource in storage. */ public function store(CreateOrUpdateRequest $request) { RequirementGroup::create([ ...$request->all(), 'company_id' => Auth::user()->company_id, ]); return $this->created(); } /** * Display the specified resource. */ public function show(string $id) { // } /** * Update the specified resource in storage. */ public function update(CreateOrUpdateRequest $request, string $id) { $group = RequirementGroup::query()->findOrFail($id); $group->fill($request->only( 'name', 'abbr_name' )); $group->save(); return $this->noContent(); } /** * Remove the specified resource from storage. */ public function destroy(string $id) { $group = RequirementGroup::query()->findOrFail($id); $group->delete(); return $this->noContent(); } }