app/Http/Controllers/CategoryController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Category  $category
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy(Category $category)
    {
        $category->delete();
        foreach($category->items as $item){
            $item->delete();
        }
        return redirect()->route('categories.index');
    }
public function destroy ( Category $ category ) { $ category -> delete ( ) ; foreach ( $ category -> items as $ item ) { $ item -> delete ( ) ; } return redirect ( ) -> route ( 'categories.index' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .