app/Http/Controllers/PageController.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)
    {
        $this->validate($request,[
            'title' => 'required|max:255',
            'user_id' => 'required',
            'content' => 'required'
        ]);
        $post = Page::create([
            'title' => $request->title,
            'content' => $request ->content,
            'keyword' => $request->keyword,
            'short_desc' => $request->short_desc,
            'user_id' => $request->user_id,
        ]);
        Session::flash('success','You have created Page succesfully');
        return redirect()->back();
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'title' => 'required|max:255' , 'user_id' => 'required' , 'content' => 'required' ] ) ; $ post = Page :: create ( [ 'title' => $ request -> title , 'content' => $ request -> content , 'keyword' => $ request -> keyword , 'short_desc' => $ request -> short_desc , 'user_id' => $ request -> user_id , ] ) ; Session :: flash ( 'success' , 'You have created Page succesfully' ) ; return redirect ( ) -> back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .