如何在Sublime for Laravel中自动列出(自动完成)父类和已使用特征的方法

时间:2019-03-30 15:44:09

标签: laravel laravel-5 sublimetext3 sublime-text-plugin

崇高的ctrl+spacectrl+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会导致大量我不知道的方法,而且我找不到所需的方法。我应该每次打开父类或特征文件吗?

0 个答案:

没有答案