thecolorred / vscode-laravel-artisan Goto Github PK
View Code? Open in Web Editor NEWVisual Studio Code Laravel Artisan Extension
Home Page: https://marketplace.visualstudio.com/items?itemName=ryannaddy.laravel-artisan
Visual Studio Code Laravel Artisan Extension
Home Page: https://marketplace.visualstudio.com/items?itemName=ryannaddy.laravel-artisan
After upgrading to version 0.0.25, the Start Server command produces "php "" serve --host='localhost --port='8000", which causes error and server cannot be launched.
When selecting start server, VSCode asks for the host and port number (recommending null for defaults).
Since we always use the default hostname and port#, it would be better to have a command "Start Server (with defaults)".
I made the needed code changes for this issue, will push the pull request soon.
Hey there,
So when I go to create a model, and answer yes to creating the controller and migration the migration file doesn't show in the tree explorer, I need to close out code or reload the window for it to show.
Commands like route listing works:
[CMD] "php74" artisan route:list
My artisan.php.location
is customized (php74 executable).
Where to see the output of command. If the command succeed then all is good but if command fails how to see the errors in this extension.
When command Fail box show up it should reference to an error page.
Helo There,
I recently begins to work with API only project on Laravel, using the plugin, i can't create the model (Artisan: Make Model) with the option "resource", because in the API, has two less methods in the controller.
I can't use the create controller (Artisan: Create Controller) either, because he only asks if the model is a resource, if i say YES, he create the controller with the two methods i don't want.
I think you can add some option on the Create Controller to ask if the controller is a API RESOURCE, like the actual.
If i ask NO to the above questions, show the question "Should i make this a API RESOURCE controller?"
In the command generated the change is only in the place of "--resource" , is "--api".
Plus you can add a final question to add a model to the controller, a question like the name, where user can insert some name on it. The changes on the command is add at the end "--model MyModel".
By the way, congrats for this awesome plugin, helps a lot in day by day.
Regards
Homestead is application official to run Laravel projects.
Add command to start up application.
I'm a VS Codium user, a FLOSS version of VS Code, it's the same code but without the Microsoft's telemetry and branding.
I want to request if possible to add the Laravel Artisan extension on the open-vsx.org market to us doesn't need to works with the Microsoft marketplace as is unclear if it's legal to use it on VS Code forks, see here.
Additional info:
Please add support to run custom Artisan commands.
For me I use:
php artisan renew:app
Thanks.
I am running a simple code from VSCode and getting following error:
[CMD] "php" artisan make:policy EmailPolicy --model=Email
[ERR] Command failed: cd /d "c:\laragon\www\zzz" && "php" artisan make:policy EmailPolicy --model=Email
'"php"' is not recognized as an internal or external command,
operable program or batch file.
If I copy/paste and run the same command via command line - it runs without any problems.
VSCode 1.40.1, Win10 x64
I'm facing a little problem that I believe is a bug.
The version showed in my VScode is 0.0.17.
I use several different languages, for this, I organize my projects in separate units of windows ("C:").
If you use the extension in a workspace located on the drive "C:" everything works normally, but in other units ex: "G:", the command does not execute.
I opened the console vscode itself trying to perform "Artisan Route List" and received the following return:
[Extension Host] Error: Command failed: cd "g:\Desenv\Php\MyProj" && php artisan route:list
(See output console for more details)
Code/resources/app/out/vs/workbench/workbench.main.js:260
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2217 The route list could not be generated
Apparently in Windows it is no use just to give a "CD" in the directory when the drive differs from "C:".
Running the same command generated in the terminal the error presented is that "artisan" was not found.
The following ways I can run through the terminal normally:
cd "g:\Develop\Php\MyProj" && G: && php artisan route: list
or
php "g:\Develop\Php\MyProj\artisan" route: list
PS. sorry for bad english
I get the following error when trying any command:
[CMD] php d:\Dropbox\Project X\backend/artisan make:controller Test --resource
[ERROR] Could not open input file: d:\Dropbox\Project
Hello!
I'd like to ask if there is any way to use this extension with Homestead properly? If I use the Config Cache or Config Refresh artisan command, my application always shows an UnexpectedValueException Protocol Error exception whenever I try to load a page. I assumed that happens because the command will need to be executed inside the VM. Well. of course, I could execute php artisan config:cache
manually via SSH, but I'd rather use this extension.
So there is any way to call into play this ext, or I have to manually modify the source code? 😄
Thanks for everyone for the answer in advance!
The command artisan.migrate.fresh Is declared twice in the commands section on package.json
and vscode report it.
{ "command": "artisan.migrate.fresh", "title": "Artisan: Migrate Fresh" },
Thx
Any time I try to use the Artisan command through this, the selection dropdown re-opens itself a few seconds later, and doing anything to make it go away clears the routes list when that is opened.
Steps: CMD+SHIFT+P, type/select Artisan:Route List, select which artisan to use, (route list appears), a few moments later select list drops down again/will not go away
after runing the command there server is started, but there is no further feedback and i cant find a way to stop it, not even closing vscode
I would like to ask the addition of the artisan make:rule
command.
unless i'm doing something wrong it looks like the the make factory command is missing but if i run artisan list:commands it shows up
Performance
laravel-artisan
0.0.25
Windows_NT x64 10.0.16299
1.33.1
C:\Users\MilaD\ryannaddy.laravel-artisan-unresponsive.cpuprofile.txt
Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load
The Extension fails to run with error "command 'artisan.route.list' not found" if artisan location is in sub directory of the workspace. There is no output channel (Laravel Artisan) in console log.
When running $ cd \d "C:\\Users\\user_name\\Projects\\workspaceRoot\\laravel_project" && php artisan -v
directly in the terminal, it works fine.
Workspace setting:
{
"artisan.location": "${workspaceRoot}\\laravel_project"
}
Vscode version: 1.24.1
Plugin version: 0.0.20
PHP version: 5.6
Laravel Framework version: 5.3.31
It opens a new cmd window for me. I'd rather have that in my integrated terminal.
Is that possible?
Please make the action field contents (which already look like a hyperlink) work on click to open the referenced file at the referenced method.
Thanks for the extension, awesome work!
This command is very useful for creating customized validation rules starting Laravel 5.5, which fact I figured out when watching "Let's Build A Forum with Laravel and TDD" on Laracasts.
However this useful command is still missing in this wonderful extension (yeah I almost threw terminal after this extension was installed haha). It'd be sweet if the author adds the command in next version ;)
...If the laravel workspace isn't the first one.
A setting to set the workspace to use would be awesome!
The command line is failing to run due to a empty string for artisan. To fix this i tried to set the directory in the artisan.location
config, this evaluates to removing any directory specifiers.
[CMD] "php" artisan make:command UserRoleManager --command=app:roles/user/add
[ERR] Command failed: cd /d "" && "php" artisan make:command UserRoleManager --command=app:add/permission
The filename, directory name, or volume label syntax is incorrect.
-- After setting artisan.location to D:\\Programming\\PHP\\Laravel\\ChaoticPanel
[CMD] "php" artisan route:list
[ERR] Command failed: cd /d "\Programming\PHP\Laravel\ChaoticPanel" && "php" artisan route:list
The system cannot find the path specified.
It seems that either the Drive specifier is being trimmed off to favour the linux file structure.
This is the stack trace incase this can help with the issue.
workbench.main.js:238 [Extension Host]
Error: Command failed: cd /d "\Programming\PHP\Laravel\ChaoticPanel" && "php" artisan route:list
The system cannot find the path specified.
(See output console for more details)
workbench.main.js:2365
The route list could not be generated (See output console)
onDidNotificationChange @ workbench.main.js:2365
_register.model.onDidNotificationChange.e @ workbench.main.js:2364
fire @ workbench.main.js:77
notify @ workbench.main.js:2420
notify @ workbench.main.js:3616
r @ workbench.main.js:3213
_showMessage @ workbench.main.js:3212
$showMessage @ workbench.main.js:3212
_doInvokeHandler @ workbench.main.js:3252
_invokeHandler @ workbench.main.js:3252
_receiveRequest @ workbench.main.js:3251
_receiveOneMessage @ workbench.main.js:3249
_protocol.onMessage.e @ workbench.main.js:3248
fire @ workbench.main.js:77
a @ workbench.main.js:321
e @ workbench.main.js:321
fire @ workbench.main.js:77
_receiveMessage @ workbench.main.js:330
S._socketDisposables.push._socketReader.onMessage.e @ workbench.main.js:327
fire @ workbench.main.js:77
acceptChunk @ workbench.main.js:323
_register._socket.onData.e @ workbench.main.js:323
t @ workbench.main.js:332
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636```
Title pretty much sums it up. When there is a search term in the search box, if I switch to another tab then back to the route list tab, the search query will be empty.
It would be great to add the command "php artisan make:auth"
Hi i am using linux and the extension does not work at all for me.
I get the following errors
[CMD] "/usr/bin/php" artisan cache:clear
[ERR] Command failed: cd "/home/tecbeast/Code/path/to/project/" && "/usr/bin/php" artisan cache:clear
Running /usr/bin/php -v
PHP 7.2.11 (cli) (built: Oct 9 2018 18:14:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
am i missing something here?
This useful extension lacks the option to generate tests, so you have to switch to the terminal for that. It'd be nice to have a command for make:test.
We have written the needed data into your clipboard. Please paste:
Would be nice to have Artisan: Make Observer
.
https://laravel.com/docs/5.8/eloquent#observers
Might submit a PR for this myself if nobody does it in the near future.
[CMD] "php" artisan module:make-controller PermissionController Admin --plain --api
I can't use options
Good Package!
As you may have known, laravel changed it's default migration primary key $table-id()
with
$table->bigIncrements('id')
so it would be appropriate for this extension to use that as well.
thanks.
firstly ,
I can use your extension is so nice and easy ,
but later,
I can't use anything commands of artisan .
always showing error ,error,error -_-
I am running on laravel 5.5 dev and PHP 7.1.7-1+ubuntu16.10.1+deb.sury.org+1 (cli)
vscode latest version
even newly laravel stable version and test your extension
but still error ..
I tested again
if I migrate refresh and ask me your extension
what database should I use ?
I typed my database name and Should I seed the database for you? yes
but result is error . not worked db seeding..
I typed just enter and should I seed the database for you? yes
but result is okay. worked db seeding..
Not working if I input the db name .
Artisan:Run Command
make:auth
report this error:
[CMD] php "e:\xxxx\front/artisan" make:auth --views= --force=
[ERROR]
The "--views" option does not accept a value.
When I generate a test it extends an unexpected TestCase
. It pulls in PHPUnit\Framework\TestCase
when it the artisan command uses Tests\TestCase
by default. Any way to update that in the configs?
When using run command
and choosing dusk
, vscode says that it cannot run the command (error). Any log I can attach?
When I try to run my docker command with this extension I got the error: the input device is not a TTY
[ERR] Command failed: cd /home/victor/projects/api/ && docker-compose exec php php artisan route:list
the input device is not a TTY
But if I just copy the command of this output and run into my terminal, works properly: cd /home/victor/projects/api/ && docker-compose exec php php artisan route:list
Does anyone have any ideia?
I am unable to run the commands against Docker, because the commands automatically cd
into the current artisanRoot
directory before running the artisan.docker.command
.
Code Output:
[CMD] php artisan route:list
[ERR] Command failed: cd /home/user/Code/laravel/laravel/ && docker-compose --user laradock exec workspace && cd /var/www/laravel/laravel php artisan route:list
Wondering if the docker logic could branch a bit more, so that:
"artisan.docker.root-path": "cd /path/to/docker-compose/repository"
could be set to know where on the local machine the artisan.docker.command
should be run from"artisan.docker.path-map": { "/var/www": "/home/user/Code" }
can be set to inform the command what directory in the container to run the command against.let localArtisanRoot = artisanRoot
let dockerPathMap = config.get('docker.path-map', null)
let dockerRoot = config.get('docker.root-path', null)
if (dockerEnabled) {
// if user did not supply a custom dockerRoot, assume we should use the local path to the current artisan
if(!dockerRoot) {
dockerRoot = localArtisanRoot
}
// if user supplied a path map, replace in the path for docker
if(dockerPathMap) {
Object.entries(dockerPathMap).forEach(([replace, find]) => artisanRoot.replace(find, replace ))
}
command = `php artisan ${command}`
cmd = `cd ${dockerRoot} && ${dockerCommand} "cd ${artisanRoot} ${command}"`
}
In this example, cmd
will evaluate to:
cd /path/to/docker-compose/repository && docker-compose exec workspace bash -c "cd /var/www/project && php artisan route:list"
[CMD] "php" artisan route:list
[ERR] stdout maxBuffer length exceeded
I am not sure how to reproduce this or this is specific to this extension but is there a fix for this?
I can successfully route:list on command line but not on this extension which is very helpful.
[CMD] "php" artisan list --format=json
[ERR] stdout maxBuffer length exceeded
Bug
laravel-artisan
0.0.27
Windows_NT x64 10.0.18363
1.46.1
Bug
laravel-artisan
0.0.27
Windows_NT ia32 10.0.17763
1.41.1
Since the artisan commands differ when using an older Laravel version (in this case 4.2), the extension's commands fail when executed (for instance, https://laravel.com/docs/4.2/migrations).
Maybe Laravel 4.2 support should be added since legacy systems still depend on older versions of Laravel.
Performance
laravel-artisan
0.0.26
Windows_NT x64 10.0.18362
1.39.0
C:\Users\Usuario\ryannaddy.laravel-artisan-unresponsive.cpuprofile.txt
Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load
I'm using PHP inside WSL, also VSCode terminal is setup using "terminal.integrated.shell.windows": "C:\\Windows\\System32\\wsl.exe",
So none of artisan commands not launching using this extension, due to missing php or paths (VSCode installed in WIndows, PHP installed in WSL)
In integrated terminal artisan commands works well.
Console output:
[CMD] php artisan route:list
[ERROR]
[CMD] php artisan make:command ads --command=asd
[ERROR]
[CMD] php artisan route:list
[ERROR]
[CMD] php artisan cache:clear
[ERROR]
[CMD] php artisan make:controller TestController --resource
[ERROR]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.