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 storePrice(Request $request)
    {
        $category = Category::find($request->input('category_id'));
        $price = new Price();
        $price->description = $request->input('description');
        $price->cost = $request->input('cost');
        $category->prices()->save($price);
        return redirect('/laundry/category/'.$category->laundry->id);
    }
public function storePrice ( Request $ request ) { $ category = Category :: find ( $ request -> input ( 'category_id' ) ) ; $ price = new Price ( ) ; $ price -> description = $ request -> input ( 'description' ) ; $ price -> cost = $ request -> input ( 'cost' ) ; $ category -> prices ( ) -> save ( $ price ) ; return redirect ( '/laundry/category/' . $ category -> laundry -> id ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .