2

How do I set the application_name as defined here http://www.postgresql.org/docs/9.1/static/libpq-connect.html, in Laravel? I see that you can do "SET application_name = 'application'" but this does not work for me. I also tried setting it in the app/config/database.php file in the 'connections' array. What am I doing wrong?

4

1 回答 1

1

您必须在 env 文件 (/.env) 中放入有关名为 DB_APPLICATION_NAME = 的应用程序名称的变量;

您必须指定以下内容: 表单 Laravel 5.5 版您可以将此行添加到 postgresql 连接底部的文件 /config/database.php 中。'application_name' => env('DB_APPLICATION_NAME', 'Laravel')

如果您未在 .env 文件中指定应用程序名称,则应用程序名称将从 /config/database.php 文件中获取。

于 2018-11-19T09:19:16.830 回答