Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pack): add laravel.nvim #1108

Merged
merged 7 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lua/astrocommunity/pack/laravel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Laravel Pack

**Note:** Installation of `phpactor` requires `composer`
**Note:** `laravel-dev-generators` in your path. See the releases section of https://github.com/haringsrob/laravel-dev-tool
**Note:** For proper blade template highlighting, you'll need to update the queries file https://github.com/EmranMR/tree-sitter-blade/discussions/20

This plugin pack does the following:

- Adds [php pack](https://github.com/AstroNvim/astrocommunity/tree/main/lua/astrocommunity/pack/php)
- Adds php and phpdoc Treesitter parsers
- Adds phpactor language servers
- Adds php-cs-fixer for formatting
- Adds php-debug-adapter for debugging
- Adds [blade pack](https://github.com/AstroNvim/astrocommunity/tree/main/lua/astrocommunity/pack/blade)
- Adds blade Treesitter parser: https://github.com/EmranMR/tree-sitter-blade
- Adds blade language server: https://github.com/haringsrob/laravel-dev-tools
- Adds blade-formatter to null-ls or conform
- Adds `laravel.nvim` for laravel specific tools
- Adds `laravel-ide-helper.nvim` for laravel model info
- Adds `blade-nav.nvim` for cmp and gf for views/routes/configs and more
64 changes: 64 additions & 0 deletions lua/astrocommunity/pack/laravel/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
return {
{ import = "astrocommunity.pack.php" },
{ import = "astrocommunity.pack.html-css" },
{ import = "astrocommunity.pack.blade" },
{
"adalessa/laravel.nvim",
cmd = { "Sail", "Artisan", "Composer", "Npm", "Yarn", "Laravel" },
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-dotenv",
"MunifTanjim/nui.nvim",
"nvimtools/none-ls.nvim",
{
"AstroNvim/astrocore",
---@param opts AstroCoreOpts
opts = function(_, opts)
local maps = assert(opts.mappings)
local prefix = "<Leader>L"
maps.n[prefix] = { desc = require("astroui").get_icon("Laravel", 1, true) .. "Laravel" }

maps.n[prefix .. "a"] = { ":Laravel artisan<CR>", desc = "Artisan" }
maps.n[prefix .. "r"] = { ":Laravel routes<CR>", desc = "Routes" }
maps.n[prefix .. "c"] = { ":Composer<CR>", desc = "Composer" }
maps.n[prefix .. "n"] = { ":Npm<CR>", desc = "Npm" }
maps.n[prefix .. "y"] = { ":Yarn<CR>", desc = "Yarn" }
end,
},
{ "AstroNvim/astroui", opts = { icons = { Laravel = "󰫐" } } },
},
event = { "VeryLazy" },
config = true,
},
{
"Bleksak/laravel-ide-helper.nvim",
dependencies = {
{
"AstroNvim/astrocore",
---@param opts AstroCoreOpts
opts = function(_, opts)
local maps = assert(opts.mappings)
local prefix = "<Leader>Li"
maps.n[prefix] = { desc = require("astroui").get_icon("IdeHelper", 1, true) .. "Laravel Ide Helper" }

maps.n[prefix .. "m"] = {
function() require("laravel-ide-helper").generate_models(vim.fn.expand "%") end,
desc = "Generate Model Info for current model",
}
maps.n[prefix .. "M"] = {
function() require("laravel-ide-helper").generate_models() end,
desc = "Generate Model Info for all models",
}
end,
},
{ "AstroNvim/astroui", opts = { icons = { IdeHelper = "󱚌" } } },
},
},
{
"ricardoramirezr/blade-nav.nvim",
dependencies = {
"hrsh7th/nvim-cmp",
},
ft = { "blade", "php" },
},
}
Loading