小编Vic*_*oni的帖子

Laravel控制器类型提示

使用-mcr(php artisan make:model Institution -mrc)创建模型后,控制器中的show函数被搭建为:

 /**
 * Display the specified resource.
 *
 * @param  \App\Organization\Institution  $institution
 * @return \Illuminate\Http\Response
 */
public function show(Institution $institution)
{
    return view('institutions.show', ['institution' => $institution]);
}
Run Code Online (Sandbox Code Playgroud)

返回查看......被我插入.我期待它用参数中发送了id的对象填充它.

/institutions/1
Run Code Online (Sandbox Code Playgroud)

但是,在使用dd($ institution)之后,我验证它有ID,而不是对象.

这个变量不应该归还我的对象吗?

php type-hinting laravel laravel-5.6

3
推荐指数
1
解决办法
2201
查看次数

PostgreSQL:pg_hba.conf中的MD5身份验证给我致命:用户“ postgres”的对等身份验证失败

我正在运行Ubuntu 14.04,并安装了PostgreSQL 9.3。将/etc/postgresql/9.3/main/pg_hba.conf编辑为:

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
Run Code Online (Sandbox Code Playgroud)

我重新启动了服务器,现在我想以postgres身份登录postgres

victor@workstation:~$ psql -U postgres
psql: FATAL:  Peer authentication failed for user "postgres"
Run Code Online (Sandbox Code Playgroud)

我已将其身份验证方法设置为MD5,因此postgres不应该提示输入密码吗?

我知道,如果我添加-h localhost它将起作用。

不添加此标志会导致psql使用对等身份验证吗?

authentication postgresql psql

0
推荐指数
1
解决办法
990
查看次数