sergeymakinen/laravel-phpstorm-stubs

该软件包已被弃用且不再维护。未建议替代包。

Laravel PhpStorm 自动完成占位符

v1.0.4 2017-03-01 18:32 UTC

This package is auto-updated.

Last update: 2020-09-09 22:54:29 UTC


README

PhpStorm (可能也适用于其他IDE) 的占位符,以实现Laravel门面、Query/Eloquent构建器的代码完成。需要Laravel 5.1或更高版本。

Packagist Version Total Downloads Software License

安装

通过 composer 安装此扩展是首选方法。

运行以下命令:

composer require "sergeymakinen/laravel-phpstorm-stubs:^1.0"

或添加以下内容到你的 composer.json 文件的 require 部分。

"sergeymakinen/laravel-phpstorm-stubs": "^1.0"

(此处省略了具体的命令和代码)

注意

如果你在Eloquent模型上没有代码完成,添加一个 Model mixin 标签,参见示例

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

/**
 * @mixin Model
 */
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
    // ...
}

祝您玩得开心!