app/Http/Controllers/ClientsController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \PurchaseControl\Clients  $clients
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(RequestsClients $request, $id)
    {
        $client = Clients::where('id', $id)->first();;
        $client->fill($request->all());
        if(!$client->save())
        {
            return redirect()->back()->withInput()->withErrors();
        }
        return redirect()->route('clients.edit', [
            'client' => $client->id
        ])->with([
            'color'=>'alert-success',
            'message' => 'Cliente Atualizado com Sucesso!'
        ]);
    }
public function update ( RequestsClients $ request , $ id ) { $ client = Clients :: where ( 'id' , $ id ) -> first ( ) ; ; $ client -> fill ( $ request -> all ( ) ) ; if ( ! $ client -> save ( ) ) { return redirect ( ) -> back ( ) -> withInput ( ) -> withErrors ( ) ; } return redirect ( ) -> route ( 'clients.edit' , [ 'client' => $ client -> id ] ) -> with ( [ 'color' => 'alert-success' , 'message' => 'Cliente Atualizado com Sucesso!' ] ) ; }
Update the specified resource in storage.
Update the specified resource in storage .