app/Http/Controllers/ArticlesController.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)
    {
        $article = Article::findOrFail($id);
        if( ! isset($request->live))
            $article->update(array_merge($request->all() , ['live' =>false]));
        else
            $article->update($request->all());
        return redirect('/articles');
    }
public function update ( Request $ request , $ id ) { $ article = Article :: findOrFail ( $ id ) ; if ( ! isset ( $ request -> live ) ) $ article -> update ( array_merge ( $ request -> all ( ) , [ 'live' => false ] ) ) ; else $ article -> update ( $ request -> all ( ) ) ; return redirect ( '/articles' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .