app/Http/Controllers/Laundry/ServicesController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function addPricing(Request $request)
    {
        $data =  $request->validate([
            'priceDescription' => 'required',
            'amount' => 'required'
        ]);
        $service = Service::findOrFail($request->input('service'));
        $service->prices()->create([
            'priceDescription' => $data['priceDescription'],
            'amount' => $data['amount']
        ]);
        return back();
    }
public function addPricing ( Request $ request ) { $ data = $ request -> validate ( [ 'priceDescription' => 'required' , 'amount' => 'required' ] ) ; $ service = Service :: findOrFail ( $ request -> input ( 'service' ) ) ; $ service -> prices ( ) -> create ( [ 'priceDescription' => $ data [ 'priceDescription' ] , 'amount' => $ data [ 'amount' ] ] ) ; return back ( ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .