app/Http/Controllers/CategoryController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Category  $category
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Request $request,Category  $category)
    {
        $category->delete();
        return back()->with('success','Category Trashed Successfully');
    }
public function destroy ( Request $ request , Category $ category ) { $ category -> delete ( ) ; return back ( ) -> with ( 'success' , 'Category Trashed Successfully' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .
// if($cat->subcategory->count() == 0){ //     Category::findOrFail($category)->delete(); //     return back()->with('success','Category Trashed Successfully'); // } // else{ //     return back()->with('error','Category has Sub Category'); // }