app/Http/Controllers/ServiceController.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 store(Request $request,$id)
    {
        $data=request()->validate([
            'service_name'=>'required',
            'service_logo'=>'required',
            'service_logo_desc'=>'required'
        ]);
        $service=Service::create([
             'service_name'=>$data['service_name'],
            'service_logo'=>$data['service_logo'],
            'service_logo_desc'=>$data['service_logo_desc'],
            'about_id'=>$id,
        ]);
        return redirect('/service');
    }
public function store ( Request $ request , $ id ) { $ data = request ( ) -> validate ( [ 'service_name' => 'required' , 'service_logo' => 'required' , 'service_logo_desc' => 'required' ] ) ; $ service = Service :: create ( [ 'service_name' => $ data [ 'service_name' ] , 'service_logo' => $ data [ 'service_logo' ] , 'service_logo_desc' => $ data [ 'service_logo_desc' ] , 'about_id' => $ id , ] ) ; return redirect ( '/service' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .