app/Http/Controllers/CategoryGroupController.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(CategoryGroupRequest $request)
    {
        $this->validate($request, [
            'category_group_code' => 'required|unique:c4s_category_group,category_group_code',
            'category_group_desc' => 'required',
        ]);
        $category_group_code = $request->input('category_group_code');
        $category_group_desc = $request->input('category_group_desc');
        $permissions = CategoryGroup::create([
            'category_group_code' => $category_group_code,
            'category_group_desc' => $category_group_desc
        ]);
        $audittrails = AuditTrail::create([
            'user_id' => $request->input('user_id'),
            'action' => $request->input('action'),
            'remarks' => "Added a record with the fields of <font class='text-danger'>$category_group_code</font> and <font class='text-danger'>$category_group_desc</font>"
        ]);
        return redirect()->route('c4s category group - create')->withStatus(__('Category Group Successfully Created.'));
    }
public function store ( CategoryGroupRequest $ request ) { $ this -> validate ( $ request , [ 'category_group_code' => 'required|unique:c4s_category_group,category_group_code' , 'category_group_desc' => 'required' , ] ) ; $ category_group_code = $ request -> input ( 'category_group_code' ) ; $ category_group_desc = $ request -> input ( 'category_group_desc' ) ; $ permissions = CategoryGroup :: create ( [ 'category_group_code' => $ category_group_code , 'category_group_desc' => $ category_group_desc ] ) ; $ audittrails = AuditTrail :: create ( [ 'user_id' => $ request -> input ( 'user_id' ) , 'action' => $ request -> input ( 'action' ) , 'remarks' => " Added a record with the fields of <font class='text-danger'> $ category_group_code </font> and <font class='text-danger'> $ category_group_desc </font> " ] ) ; return redirect ( ) -> route ( 'c4s category group - create' ) -> withStatus ( __ ( 'Category Group Successfully Created.' ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .