app/Http/Controllers/SuggestionController.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)
    {
        if ($request->input('mark') != null) {
            Log::info('marking');
            $suggestion = Suggestion::find($id);
            $suggestion->marked = true;
            $suggestion->save();
        }
        else if ($request->input('restore') != null) {
            $suggestion = Suggestion::withTrashed()->find($id);
            $suggestion->restore();
        }
        else if ($request->input('unmark') != null) {
            $suggestion = Suggestion::find($id);
            $suggestion->marked = false;
            $suggestion->save();
        }
        return Redirect::back();
    }
public function update ( Request $ request , $ id ) { if ( $ request -> input ( 'mark' ) != null ) { Log :: info ( 'marking' ) ; $ suggestion = Suggestion :: find ( $ id ) ; $ suggestion -> marked = true ; $ suggestion -> save ( ) ; } else if ( $ request -> input ( 'restore' ) != null ) { $ suggestion = Suggestion :: withTrashed ( ) -> find ( $ id ) ; $ suggestion -> restore ( ) ; } else if ( $ request -> input ( 'unmark' ) != null ) { $ suggestion = Suggestion :: find ( $ id ) ; $ suggestion -> marked = false ; $ suggestion -> save ( ) ; } return Redirect :: back ( ) ; }
Update the specified resource in storage.
Update the specified resource in storage .