app/Http/Controllers/SettingController.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)
    {
        $request->validate([
            'phone' => 'required',
            'email' => 'required',
            'about_app' => 'required',
            'fb_link' => 'required',
            'tw_link' => 'required',
            'inst_link' => 'required'
        ]);
        $setting = new Setting;
        $setting->phone = $request->phone;
        $setting->email = $request->email;
        $setting->about_app = $request->about_app;
        $setting->fb_link = $request->fb_link;
        $setting->tw_link = $request->tw_link;
        $setting->inst_link = $request->inst_link;
        $setting->save();
        return redirect(route('setting.index'));
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'phone' => 'required' , 'email' => 'required' , 'about_app' => 'required' , 'fb_link' => 'required' , 'tw_link' => 'required' , 'inst_link' => 'required' ] ) ; $ setting = new Setting ; $ setting -> phone = $ request -> phone ; $ setting -> email = $ request -> email ; $ setting -> about_app = $ request -> about_app ; $ setting -> fb_link = $ request -> fb_link ; $ setting -> tw_link = $ request -> tw_link ; $ setting -> inst_link = $ request -> inst_link ; $ setting -> save ( ) ; return redirect ( route ( 'setting.index' ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//validation //store