Skip to content
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
7 changes: 4 additions & 3 deletions lua/laravel/ide_helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
local M = {}

local ui = require('laravel.ui')
local sail = require('laravel.sail')

-- Cache for IDE helper completions
local cache = {
Expand Down Expand Up @@ -78,9 +79,9 @@ local function ensure_ide_helper_files()
if choice == 1 then
-- Generate files
local commands = {
'php artisan ide-helper:generate',
'php artisan ide-helper:models --write',
'php artisan ide-helper:meta'
sail.wrap_command('php artisan ide-helper:generate'),
sail.wrap_command('php artisan ide-helper:models --write'),
sail.wrap_command('php artisan ide-helper:meta')
}

for _, cmd in ipairs(commands) do
Expand Down
14 changes: 8 additions & 6 deletions plugin/laravel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if vim.g.loaded_laravel_nvim then
end
vim.g.loaded_laravel_nvim = true

local sail = require('laravel.sail')

-- Check if we're in a Laravel project
local function is_laravel_project()
local markers = { 'artisan', 'composer.json', 'app/Http', 'config/app.php' }
Expand Down Expand Up @@ -589,13 +591,13 @@ local function setup_commands()
local root = _G.laravel_nvim.project_root

local commands = {
generate = 'php artisan ide-helper:generate',
models = 'php artisan ide-helper:models --write',
meta = 'php artisan ide-helper:meta',
generate = sail.wrap_command('php artisan ide-helper:generate'),
models = sail.wrap_command('php artisan ide-helper:models --write'),
meta = sail.wrap_command('php artisan ide-helper:meta'),
all = {
'php artisan ide-helper:generate',
'php artisan ide-helper:models --write',
'php artisan ide-helper:meta'
sail.wrap_command('php artisan ide-helper:generate'),
sail.wrap_command('php artisan ide-helper:models --write'),
sail.wrap_command('php artisan ide-helper:meta')
}
}

Expand Down