app/Http/Controllers/Management/School/FundamentServiceSocialController.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)
    {
        $validatedData = $request->validate([
            'desc_fundamento' => 'required|string|max:255'
        ]);
        $action = 'Fundamento::update';
        $table  = 'fundamentos';
        try {
            $fundamento = Fundamento::findOrFail($id);
            if ( $fundamento->update($request->all()) )
                 if ( $this->history($fundamento, $action, $table) )
                    $response = 202;
                else    
                    $response = 303; 
            else    
                $response = 302;
        } catch (Exception $e) {
            $response = 302;
        }
    return redirect()->route('fundament.index')->with('code', $response);
    }
public function update ( Request $ request , $ id ) { $ validatedData = $ request -> validate ( [ 'desc_fundamento' => 'required|string|max:255' ] ) ; $ action = 'Fundamento::update' ; $ table = 'fundamentos' ; try { $ fundamento = Fundamento :: findOrFail ( $ id ) ; if ( $ fundamento -> update ( $ request -> all ( ) ) ) if ( $ this -> history ( $ fundamento , $ action , $ table ) ) $ response = 202 ; else $ response = 303 ; else $ response = 302 ; } catch ( Exception $ e ) { $ response = 302 ; } return redirect ( ) -> route ( 'fundament.index' ) -> with ( 'code' , $ response ) ; }
Update the specified resource in storage.
Update the specified resource in storage .