app/Http/Controllers/LinkController.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(UpdateLink $request, $id)
    {
        $link = Link::where('id', $id)->first();
        Click::where('link', $link->input_url)->update(['link' => $request->input_url]);
        if($link->update([
            'input_url' => $request->input_url,
            'output_url' => $request->output_url]))
            {
                return redirect()->route('profile')
                    ->with('success', 'News edition success');
            }
        return back()->with('error', 'News edition error');
    }
public function update ( UpdateLink $ request , $ id ) { $ link = Link :: where ( 'id' , $ id ) -> first ( ) ; Click :: where ( 'link' , $ link -> input_url ) -> update ( [ 'link' => $ request -> input_url ] ) ; if ( $ link -> update ( [ 'input_url' => $ request -> input_url , 'output_url' => $ request -> output_url ] ) ) { return redirect ( ) -> route ( 'profile' ) -> with ( 'success' , 'News edition success' ) ; } return back ( ) -> with ( 'error' , 'News edition error' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .