app/Http/Controllers/Admin/BodyPartController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $bodyPart = BodyPart::findOrFail($id);
        $bodyPart->update([
            'body_part' => $request->body_part,
            'active' => (!empty($request->active)) ? 1 : 0
        ]);
        return redirect('/admin/body-parts');
    }
public function update ( Request $ request , $ id ) { $ bodyPart = BodyPart :: findOrFail ( $ id ) ; $ bodyPart -> update ( [ 'body_part' => $ request -> body_part , 'active' => ( ! empty ( $ request -> active ) ) ? 1 : 0 ] ) ; return redirect ( '/admin/body-parts' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .