tutorigo/laravel-ide-macros 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tutorigo/laravel-ide-macros

最新稳定版本:1.6.0

Composer 安装命令:

composer require tutorigo/laravel-ide-macros

包简介

Generating a helper file for IDEs to support Laravel's macros.

README 文档

README

Warning
This repository is archived because I'm unable to maintain it, as I'm not a web developer anymore and forgot most of this stuff.

Please use an existing fork, or create your own with your changes.

Sorry about this, have fun working on whatever you're currently building :)

Laravel IDE Macros

It is advised to be used with Laravel IDE Helper, which generates helper files for your IDE, so it'll be able to highlight and understand some Laravel-specific syntax. This package provides an additional IDE helper file for Laravel macros with the syntax you are already used to in Laravel IDE Helper.

Installation

Just require it in your Composer file, and you are good to go:

"tutorigo/laravel-ide-macros": "*"

If you are using Laravel 5.4 or lower, you must register the IdeMacrosServiceProvider manually.

Configuration

Run the following command to publish the configuration file to config/ide-macros.php:

php artisan vendor:publish --provider="Tutorigo\LaravelMacroHelper\IdeMacrosServiceProvider"

Usage

Generate helper file

Run the following command to generate the macro IDE helpers:

php artisan ide-helper:macros

Use of non-static macros

Macros can be both static (ie. Route::sth()) and non-static (ie. Request::route()->sth()). To distinct the two, use the @instantiated tag in the PHPDoc of macros, which depend on $this, for example:

/**
 * Gets the amount of route parameters
 *
 * @return array
 * @instantiated
 */
\Illuminate\Routing\Route::macro('parameterCount', function () {
    /** @var \Illuminate\Routing\Route $this */
    return count($this->parameters);
});

统计信息

  • 总下载量: 335.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 44
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 44
  • Watchers: 2
  • Forks: 30
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-22