app/Http/Controllers/Management/School/MexicanStateController.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([
            'nombreCarrera' => 'required|string|max:255',
            'modalidad' => 'required|string|max:255',
            'nivel' => 'required|string|max:255',
            'noRevoe' => 'required|string|max:100',
            'autorizacion_id' => 'required|integer|min:1|max:9999999999',
            'institucion_id' => 'required|integer|min:1|max:9999999999',
            'edo' => 'required|numeric|min:1|max:9999999999',
        ]);
        $action = 'Entidad::update';
        $table  = 'estados';
        try {
            $estados = Entidad::findOrFail($id);
            if ( $estados->update($request->all()) )
                 if ( $this->history($estados, $action, $table) )
                    $response = 202;
                else    
                    $response = 303; 
            else    
                $response = 302;
        } catch (Exception $e) {
            $response = 302;
        }
    return redirect()->route('state.index')->with('code', $response);
    }
public function update ( Request $ request , $ id ) { $ validatedData = $ request -> validate ( [ 'nombreCarrera' => 'required|string|max:255' , 'modalidad' => 'required|string|max:255' , 'nivel' => 'required|string|max:255' , 'noRevoe' => 'required|string|max:100' , 'autorizacion_id' => 'required|integer|min:1|max:9999999999' , 'institucion_id' => 'required|integer|min:1|max:9999999999' , 'edo' => 'required|numeric|min:1|max:9999999999' , ] ) ; $ action = 'Entidad::update' ; $ table = 'estados' ; try { $ estados = Entidad :: findOrFail ( $ id ) ; if ( $ estados -> update ( $ request -> all ( ) ) ) if ( $ this -> history ( $ estados , $ action , $ table ) ) $ response = 202 ; else $ response = 303 ; else $ response = 302 ; } catch ( Exception $ e ) { $ response = 302 ; } return redirect ( ) -> route ( 'state.index' ) -> with ( 'code' , $ response ) ; }
Update the specified resource in storage.
Update the specified resource in storage .