app/Http/Controllers/PageController.php
/**
         * Store a newly created resource in storage.
         *
         * @param Request $request
         */
Store a newly created resource in storage.
@param Request $request
Store a newly created resource in storage . @param Request $request
public function store(Request $request){
        $page = $request->isMethod('put') ? Page::where('page_name',$request->page_name)->firstOrFail() : new Page;
        $page->page_name = $request->input('page_name');
        $page->indexable = $request->input('indexable');
        $page->image_name = $request->input('image_name');
        $page->meta_title = $request->input('meta_title');
        $page->meta_descr = $request->input('meta_descr');
        $page->fb_pixel = $request->input('fb_pixel');
        $page->google = $request->input('google');
        $page->contact_email = $request->input('contact_email');
        if ($page->save()) {
            return $page;
        }  
            return null;
    }
public function store ( Request $ request ) { $ page = $ request -> isMethod ( 'put' ) ? Page :: where ( 'page_name' , $ request -> page_name ) -> firstOrFail ( ) : new Page ; $ page -> page_name = $ request -> input ( 'page_name' ) ; $ page -> indexable = $ request -> input ( 'indexable' ) ; $ page -> image_name = $ request -> input ( 'image_name' ) ; $ page -> meta_title = $ request -> input ( 'meta_title' ) ; $ page -> meta_descr = $ request -> input ( 'meta_descr' ) ; $ page -> fb_pixel = $ request -> input ( 'fb_pixel' ) ; $ page -> google = $ request -> input ( 'google' ) ; $ page -> contact_email = $ request -> input ( 'contact_email' ) ; if ( $ page -> save ( ) ) { return $ page ; } return null ; }
Store a newly created resource in storage.
Store a newly created resource in storage .