merchant_id=merchant('id'); $table->ip=request()->getClientIp(); $table->desc=$str; $table->url=request()->path();//操作路径 return $table->save(); } public function merchants(){ return $this->belongsTo('App\Models\Merchant','merchant_id','id'); } }