app/Http/Controllers/SubCategoryController.php
/**
     * Update the specified resource in storage.
     *
     * @param Request $request
     * @param SubCategory $subCategory
     * @return JsonResponse
     */
Update the specified resource in storage.
@param Request $request
@param SubCategory $subCategory
@return JsonResponse
Update the specified resource in storage . @param Request $request @param SubCategory $subCategory @return JsonResponse
public function update(Request $request, SubCategory $subCategory)
    {
        $request->validate(
            [
                'category_id' => 'nullable|exists:categories,id',
                'name' => ''
            ]
        );
        if ($subCategory->update($request->all()))
        {
            return Helper::response_with_data($subCategory, false);
        }
        return Helper::response_with_data(null, false);
    }
public function update ( Request $ request , SubCategory $ subCategory ) { $ request -> validate ( [ 'category_id' => 'nullable|exists:categories,id' , 'name' => '' ] ) ; if ( $ subCategory -> update ( $ request -> all ( ) ) ) { return Helper :: response_with_data ( $ subCategory , false ) ; } return Helper :: response_with_data ( null , false ) ; }
Update the specified resource in storage.
Update the specified resource in storage .