app/Http/Controllers/DataBaseController.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)
    {
        $request->validate([
            'descricao' => 'required',
            'host' => 'required',
            'port' => 'required',
            'base' => 'required',
        ]);
        $dataBase = DataBase::find($id);
        $dataBase->update($request->all());
        $data = DataBase::latest()->paginate(10);
        return view('data-base.index',compact('data'))
            ->with('i', (request()->input('page', 1) - 1) * 5)
            ->with('success','Post updated successfully');
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( [ 'descricao' => 'required' , 'host' => 'required' , 'port' => 'required' , 'base' => 'required' , ] ) ; $ dataBase = DataBase :: find ( $ id ) ; $ dataBase -> update ( $ request -> all ( ) ) ; $ data = DataBase :: latest ( ) -> paginate ( 10 ) ; return view ( 'data-base.index' , compact ( 'data' ) ) -> with ( 'i' , ( request ( ) -> input ( 'page' , 1 ) - 1 ) * 5 ) -> with ( 'success' , 'Post updated successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .