app/Http/Controllers/ContactDetailController.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([
           'contact_name'=>'required',
           'contact_icons'=>'required',
           'contact_content'=>'required'
       ]);
       $cont=ContactDetail::create([
          'contact_id'=>$id,
          'contact_name'=>$data['contact_name'],
          'contact_icons'=>$data['contact_icons'],
          'contact_content'=>$data['contact_content']
       ]);
       return redirect('/ContactDetails');
    }
public function store ( Request $ request , $ id ) { $ data = request ( ) -> validate ( [ 'contact_name' => 'required' , 'contact_icons' => 'required' , 'contact_content' => 'required' ] ) ; $ cont = ContactDetail :: create ( [ 'contact_id' => $ id , 'contact_name' => $ data [ 'contact_name' ] , 'contact_icons' => $ data [ 'contact_icons' ] , 'contact_content' => $ data [ 'contact_content' ] ] ) ; return redirect ( '/ContactDetails' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .