haringsrob/laravel-dev-tools
最新稳定版本:1.0.0
Composer 安装命令:
composer create-project haringsrob/laravel-dev-tools
包简介
Laravel dev tools contains of multiple tools to ease Laravel development: Blade lsp
README 文档
README
The Laravel/Blade lsp provides:
Blade:
- Diagnostics on missing components + action to create it.
- Autocomplete for components and their arguments.
- Hover shows the path to the view.
- Goto definition on components to jump to the view or component class.
Livewire:
- Autocomplete for livewire components and their arguments.
- Autocomplete for livewire wireable properties.
- Goto definition to the livewire class (not yet the view).
- Hover shows the path to the view.
- Diagnostics on missing wire:model rules/parameters or missing wire:click methods.
- Diagnostics on missing components + action to create it.
Extractors for (external) lsp:
- routes() autocomplete
- views() autocomplete
- container autocomplete
- config() autocomplete
- Php autocomplete in blade
- Model information, relation builders
Demo
Status
This LSP is still to be considered unstable. If you find issues, you are welcome to provide a issue/pull request with a reproducable example.
Issues without clear steps to reproduce may be closed without answer.
As it is experimental, there is no guarantee whatsoever that this will work. Please always ensure your code is under version control.
Thing may be slow.
Installation
Requirements
PHP 8.0, older versions will NOT work. (not even trying). LARAVEL 8.0, older versions will NOT work.
This LSP is based on php in your runtime. I have not tested this with docker so for now assume it will not work from outside.
Your application needs to be bootable. This LSP will run commands in your codebase to get all the information it needs. (Much like running laravel-ide-helper).
Vscode
!! Not up to date, so best to build it yourself for now.
Install Name: laravel-blade syntax
Download the extension from the vscode extensions.
(Neo)vim
Download the compiled version from the releases then use it to setup the lsp:
This depends on your setup, below are instruction for using it with nvim-lspconfig
local lspconfig = require'lspconfig' local configs = require 'lspconfig.configs' -- Configure it configs.blade = { default_config = { -- Path to the executable: laravel-dev-generators cmd = { "laravel-dev-generators", "lsp" }, filetypes = {'blade'}; root_dir = function(fname) return lspconfig.util.find_git_ancestor(fname) end; settings = {}; }; } -- Set it up lspconfig.blade.setup{ -- Capabilities is specific to my setup. capabilities = capabilities }
Building from source
This LSP is based on the great work in phpactor/language-server
As it is php it actually does not need building, but we can still do this by makeing a phar so it is easier to distribute.
To build the phar you run:
./laravel-dev-tools app:build
Building the vscode extension
To build the vscode extension we have to build the phar and copy it to the extension's directory:
./laravel-dev-tools app:build --build-version=1 && cp builds/laravel-dev-tools extensions/vscode/laravel-dev-tools
Then in the extensions/vscode directory we do:
Install npm modules: npm install
Then make the package: npm run package
(for me: publish using vsce publish)
Licence notes
This project is based on Laravel Zero
It uses phpactor/language-server for the LSP layer.
Other packages used are:
- Spatie invade
- To extract information out of laravel's core.
- Laravel
- Best php framework ever, and needed for it's types.
- Soyhuce/next-ide-helper
- To extract model information.
Todo's
- Auto copy the readme/Licence to the extension folder when building.
haringsrob/laravel-dev-tools 适用场景与选型建议
haringsrob/laravel-dev-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 99, 最近一次更新时间为 2023 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「console」 「laravel」 「blade」 「LSP」 「Language server」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 haringsrob/laravel-dev-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 haringsrob/laravel-dev-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 haringsrob/laravel-dev-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
A table generator class for the PHP CLI.
Slim starter / Slim skeleton package to boost your development with Slim framework
Generates a trait to help ease the access of custom repo methods
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 99
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: APACHE
- 更新时间: 2023-04-17
