app/Http/Controllers/__Old__/__CategoryController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(CreateCategoryRequest $request)
    {
        $category = new Category;
            $category->name = $request->name;
            $category->module_id = $request->module_id;
        $category->save();
        Log::info(Auth::user()->username . " (" . Auth::user()->id . ") CREATED category (" . $category->id . ")\r\n", 
            [$category = json_decode($category, true)]
        );
        Session::flash('success','The new category has been created');
        return redirect()->route('categories.index');
    }
public function store ( CreateCategoryRequest $ request ) { $ category = new Category ; $ category -> name = $ request -> name ; $ category -> module_id = $ request -> module_id ; $ category -> save ( ) ; Log :: info ( Auth :: user ( ) -> username . "  ( " . Auth :: user ( ) -> id . " ) CREATED category ( " . $ category -> id . " ) \r \n " , [ $ category = json_decode ( $ category , true ) ] ) ; Session :: flash ( 'success' , 'The new category has been created' ) ; return redirect ( ) -> route ( 'categories.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// Save entry to log file using built-in Monolog