崇高的ctrl+space
和ctrl+r
快捷方式下拉了一些方法,但我想我需要更多。在一个示例中:
Illuminate \ Foundation \ Auth \ User.php
<?php
namespace Illuminate\Foundation\Auth;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword;
}
Laravel的默认User
模型是这样扩展的:
app / User.php
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}
现在在控制器中,我可以使用User
模型。我想要的是,当我输入User::
和ctrl+"some super shortcut"
时,我希望看到像Model
这样的父-父类的方法(例如getKeyName()
)和{{1 }}特性。但是输入Authenticatable, Authorizable, CanResetPassword
会导致大量我不知道的方法,而且我找不到所需的方法。我应该每次打开父类或特征文件吗?