app/Http/Controllers/AdminCommentsController.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)
    {
        $user = Auth::user();
        $data = [
            'post_id' => $request->post_id,
            'author'  => $user->name,
            'email'   => $user->email,
            'photo'   => $user->photo->file,
            'body'    => $request->body
        ];
        Comment::create($data,compact('user'));
        $request->session()->flash('msg_comment','your message has been submitted');
        return redirect()->back();
    }
public function store ( Request $ request ) { $ user = Auth :: user ( ) ; $ data = [ 'post_id' => $ request -> post_id , 'author' => $ user -> name , 'email' => $ user -> email , 'photo' => $ user -> photo -> file , 'body' => $ request -> body ] ; Comment :: create ( $ data , compact ( 'user' ) ) ; $ request -> session ( ) -> flash ( 'msg_comment' , 'your message has been submitted' ) ; return redirect ( ) -> back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//