app/Http/Controllers/Admin/MuscleController.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)
    {
        $this->validate($request, [
            'body_part_id' => 'required',
            'muscle_name' => 'required'
        ]);
        $muscle = Muscle::findOrFail($id);
        $muscle->update([
            'body_part_id' => $request->body_part_id,
            'muscle_name' => $request->muscle_name,
            'active' => (!empty($request->active)) ? 1 : 0
        ]);
        return redirect('/admin/muscles');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'body_part_id' => 'required' , 'muscle_name' => 'required' ] ) ; $ muscle = Muscle :: findOrFail ( $ id ) ; $ muscle -> update ( [ 'body_part_id' => $ request -> body_part_id , 'muscle_name' => $ request -> muscle_name , 'active' => ( ! empty ( $ request -> active ) ) ? 1 : 0 ] ) ; return redirect ( '/admin/muscles' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .