app/Http/Controllers/MessageController.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)
    {
        $message = new Message() ;
        $message->body = $request->body ;
        $message->read = false ;
        $message ->user_id =1 ;
        $message-> conversation_id = 1 ;
        $message->conversation_id = $request['conversation_id'] ;
        $message->save();
        return $message;
    }
public function store ( Request $ request ) { $ message = new Message ( ) ; $ message -> body = $ request -> body ; $ message -> read = false ; $ message -> user_id = 1 ; $ message -> conversation_id = 1 ; $ message -> conversation_id = $ request [ 'conversation_id' ] ; $ message -> save ( ) ; return $ message ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// We create a new message // Now we save the message