菜谱项目

UserMessage.php 613B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Support\Facades\DB;
  6. class UserMessage extends Model
  7. {
  8. protected $table = "user_message";
  9. public static function addFeedBack(Request $request)
  10. {
  11. return DB::table('user_message')->insert([
  12. // 'user_id'=>User::getCurrentUser()->id,
  13. 'user_id' => 0,
  14. 'message' => $request->input('message'),
  15. 'version' => $request->header('version'),
  16. 'created_at' => time(),
  17. 'updated_at' => time(),
  18. ]);
  19. }
  20. }