app/Http/Controllers/__Old__/__CategoryController.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(UpdateCategoryRequest $request, $id)
    {
        $category = Category::find($id);
            $category->name = $request->input('name');
            $category->module_id = $request->input('module_id');
        $category->save();
        Log::info(Auth::user()->username . " (" . Auth::user()->id . ") UPDATED category (" . $category->id . ")\r\n",
            [$category = json_decode($category, true)]
        );
        Session::flash ('success', 'The category was successfully updated!');
        return redirect()->route('categories.index');
    }
public function update ( UpdateCategoryRequest $ request , $ id ) { $ category = Category :: find ( $ id ) ; $ category -> name = $ request -> input ( 'name' ) ; $ category -> module_id = $ request -> input ( 'module_id' ) ; $ category -> save ( ) ; Log :: info ( Auth :: user ( ) -> username . "  ( " . Auth :: user ( ) -> id . " ) UPDATED category ( " . $ category -> id . " ) \r \n " , [ $ category = json_decode ( $ category , true ) ] ) ; Session :: flash ( 'success' , 'The category was successfully updated!' ) ; return redirect ( ) -> route ( 'categories.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// Get the category value from the database // Save the data to the database // Save entry to log file using built-in Monolog // Set flash data with success message // Redirect to posts.show