回答編集履歴
2
link
    
        answer	
    CHANGED
    
    | 
         @@ -15,11 +15,11 @@ 
     | 
|
| 
       15 
15 
     | 
    
         
             
            また、 `fill` メソッドを使用して値を複数代入する場合は、
         
     | 
| 
       16 
16 
     | 
    
         
             
            `App\Model\ChatConversation` の `$fillable` プロパティにカラムのホワイトリストを設定する必要があります。
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            https://readouble.com/laravel/6.x/ja/eloquent.html#mass-assignment
         
     | 
| 
      
 18 
     | 
    
         
            +
            [https://readouble.com/laravel/6.x/ja/eloquent.html#mass-assignment](https://readouble.com/laravel/6.x/ja/eloquent.html#mass-assignment)
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
            また、質問とは関係ないですが...
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
            https://readouble.com/laravel/6.x/ja/controllers.html#resource-controllers
         
     | 
| 
      
 22 
     | 
    
         
            +
            [https://readouble.com/laravel/6.x/ja/controllers.html#resource-controllers](https://readouble.com/laravel/6.x/ja/controllers.html#resource-controllers)
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            また、関数名は任意ではありますが公式のリソースコントローラのアクション名に準拠するとより良いと思います。
         
     | 
| 
       25 
25 
     | 
    
         
             
            `add` ではなく、 `create` の命名を推奨します。
         
     | 
1
整備
    
        answer	
    CHANGED
    
    | 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            Illuminate\Http\Request に save メソッドはありません。
         
     | 
| 
      
 1 
     | 
    
         
            +
            `Illuminate\Http\Request` に `save` メソッドはありません。
         
     | 
| 
       2 
     | 
    
         
            -
            App\Model\ChatConversation モデルの save メソッドを利用してDBに保存しましょう。
         
     | 
| 
      
 2 
     | 
    
         
            +
            `App\Model\ChatConversation` モデルの `save` メソッドを利用してDBに保存しましょう。
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            使用例はこんな感じです。
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
         @@ -12,8 +12,8 @@ 
     | 
|
| 
       12 
12 
     | 
    
         
             
            }
         
     | 
| 
       13 
13 
     | 
    
         
             
            ```
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
            また、 fill メソッドを使用して値を複数代入する場合は、
         
     | 
| 
      
 15 
     | 
    
         
            +
            また、 `fill` メソッドを使用して値を複数代入する場合は、
         
     | 
| 
       16 
     | 
    
         
            -
            App\Model\ChatConversation の $fillable プロパティにカラムのホワイトリストを設定する必要があります。
         
     | 
| 
      
 16 
     | 
    
         
            +
            `App\Model\ChatConversation` の `$fillable` プロパティにカラムのホワイトリストを設定する必要があります。
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
            https://readouble.com/laravel/6.x/ja/eloquent.html#mass-assignment
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
         @@ -22,4 +22,4 @@ 
     | 
|
| 
       22 
22 
     | 
    
         
             
            https://readouble.com/laravel/6.x/ja/controllers.html#resource-controllers
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
            また、関数名は任意ではありますが公式のリソースコントローラのアクション名に準拠するとより良いと思います。
         
     | 
| 
       25 
     | 
    
         
            -
            add ではなく、 create の命名を推奨します。
         
     | 
| 
      
 25 
     | 
    
         
            +
            `add` ではなく、 `create` の命名を推奨します。
         
     |