So I'm trying to pass a test given to me by the Sr dev. Any help is greatly appreciated. My Store should return a 201 response. I've gotten it to return a 200 response several different ways, but I'm obviously missing something. Here is my Store function in the controller:
` public function store(Request $request, GLCode $glcode)
{
$request->only([ 'id', 'location_id', 'gl_type_id', 'description', 'code', 'protected' ]);
$request->validate([
'id' => [ 'required', 'integer' ],
'location_id' => [ 'required', 'integer' ],
'gl_type_id' => [ 'required', 'integer' ],
'description' => [ 'required', 'string' ],
'code' => [ 'required', 'string' ],
'protected' => [ 'required', 'boolean' ],
]);
$glcode->id = $request->get('id');
$glcode->location_id = $request->get('location_id');
$glcode->gl_type_id = $request->get('gl_type_id');
$glcode->description = $request->get('description');
$glcode->code = $request->get('code');
$glcode->protected = $request->get('protected');
return response()->json(new GLCodeResource($glcode));
}`