app/Http/Controllers/Laundry/LaundriesController.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 storeCategory(Request $request,$id)
    {
        $laundry = Laundry::findOrFail($id);
        $category = new Category();
        $category->name = $request->input('name');
        $laundry->categories()->save($category);
        return redirect('/laundry/category/'.$laundry->id);
    }
public function storeCategory ( Request $ request , $ id ) { $ laundry = Laundry :: findOrFail ( $ id ) ; $ category = new Category ( ) ; $ category -> name = $ request -> input ( 'name' ) ; $ laundry -> categories ( ) -> save ( $ category ) ; return redirect ( '/laundry/category/' . $ laundry -> id ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .