How to run command in Netbean IDE - php

Recently learning Laravel using netbean IDE, I saw some command like
cygcheck -c cygwin
composer require barryvdh/laravel-ide-helper
php artisan ide-helper:generate
but i don know how I can run them, tried to run in CMD, but the file generate in different location and php php artisan ide-helper:generate is not supported.

Related

php artisan migrate nothing to migrate error

I am trying to install this package on my server after installing everything when I try to migrate with php artisan migrate it tells me there is nothing to migrate. Also the migration table is not there. here is what I did:
php composer.phar require igaster/laravel_cities
change in providers app.php
Igaster\LaravelCities\GeoServiceProvider::class,
Ran this script
mkdir storage/geo
cd storage/geo
wget http://download.geonames.org/export/dump/allCountries.zip && unzip allCountries.zip && rm allCountries.zip
wget http://download.geonames.org/export/dump/hierarchy.zip && unzip hierarchy.zip && rm hierarchy.zip
Now when I run php artisan migrate it tells me there is nothing to migrate
I am not sure if this is because I have php composer.phar instead of composer?
Try php artisan config:cache then retype php artisan migrate - Hope this helpfull...
Try running:
php artisan vendor:publish --provider="Igaster\LaravelCities\GeoServiceProvider"
And then run the migration
php artisan migrate
php composer.phar is identical to composer so thats not the issue.
If migration file not showing you likely need to run
php artisan vendor:publish
Copy vendor/igaster/laravel_cities/src/migrations folder contents to database\migrations folder, then run php artisan migrate. Sometimes publishing vendor resources doesn't work for me too and I dive into the source of the package then to make them work.

Composer PHP script running old PHP version causing syntax errors?

I am using composer's post-update-cmd with Laravel. My code is written in PHP 7, I think composer's script call is running an old version because I am getting syntax error on executing php artisan ide-helper:generate. Running the command manually in terminal does not trigger any errors.
How do I specify or configure composer's php to use a specific php path? Using #php, does not seem to work as "artisan" as the path becomes invalid:
You made a reference to a non-existent script #php artisan
ide-helper:generate
Here's my composer.json:
...
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan optimize"
]
...
I was receiving a similar error (my particular error was with the final script, #php artisan optimize)
Composer was already using PHP 7.1 correctly. Running composer selfupdate fixed this error.
So composer is somehow running the old php even though my ~/.bash_profile is pointing php to a new version.
To prove it, executing php -v was showing PHP 7. Whereas executing composer exec 'php -v' was showing php 5.6.
So after being bothered by this for a few days, I finally tried this. Apparently, the order of ~/.bash_profile matters.
I changed this:
alias composer="php /usr/local/bin/composer.phar"
export PATH=/Applications/MAMP/bin/php/php7.0.8/bin:$PATH
To:
export PATH=/Applications/MAMP/bin/php/php7.0.8/bin:$PATH
alias composer="php /usr/local/bin/composer.phar"
and reload the profile by executing source ~/.bash_profile
Now composer exec 'php -v' shows php 7!
First check the version of your php.
by entering this command to your command prompt(cmd): php -v
If it's showing the wrong version there's a conflict happening.
find the conflicting app by finding the source of your php (cmd): php --ini
the prompt will now tell you where the file is coming from.
You can then uninstall the app that's hosting the old php file. Then your system should automatically use the newer php.

Where do I run "php artisan make:migration posts" on WIndows?

I am following this tutorial: http://www.findalltogether.com/tutorial/simple-blog-application-in-laravel-5-part-1-setup-database/ to set up a Blog using Laravel.
In the tutorial, it says to make migrations I've to run php artisan make:migration posts. Where do I run this? I tried bash but received the error: Could not open input file: artisan.
I'm on Windows, using xampp - could this be a reason?
Thank you
You have to go in folder where artisan is located (usally root of project) and with CMD or CONSOLE write php artisan make:migration posts
First Navigate to your project directory from command prompt if you have installed the laravel in your project so there should be artisan available you may find by typing "dir" once you find artisan there you should run your respective command. Moreover once you reached to your project directory for testing purpose you may write this line
" php artisan " (without quotes) and press enter you will see all the list of commands available in artisan.
Thanks

How do I remove old artisan command from Kernel in Laravel 5

I have created some Command files into my Laravel Application. Laravel version is 5.2. I set command like: get:email in the Command file. Also call the Command file into Kernel.php. After that I can see the artisan command list by typing the command php artisan list. as like as below:
//output
get:email
And I changed the command title get:email to get-bq:email. When I run the command php artisan get-bq:email -- its working nicely. Also I can see the list by typing the command php artisan list::
//output
get-bq:email
Issue / Problem: Both commands are working. But I won't to work with both of them. I have done the following things:
modified command file as well as command
run composer dump-autoload -o
run composer update
remove vendor and storage folder then run composer update again.
Still the old command is working into my system.
What I want: How May I remove my old commands from my Laravel(5.2) application?
Run these commands:
php artisan cache:clear
php artisan config:clear
These commands will clear app cache and config cache and recreate it.
I've had the same problem recently.
Repoeatedly tried
php artisan cache:clear
php artisan config:clear
and the cached Kernal command wouldn't clear.
In desperation i killed the queue worker terminal and restarted the queue with the command
php artisan queue:work
The issue stopped.

Installation issue in laravel bundle with commands

I am new to Laravel. I have never used artisan commands. Now I'm trying to install a bundle, but it says to run this commands: php artisan bundle:install charisma and `php artisan bundle:publish. I don't know how to run these commands and WHERE to run these commands for installation. Can anyone please tell me step by step how and where these commands work.
You should run those commands at the terminal.
Let's suppose you have Laravel installed on documents/projects/test.
cd documents/projects/test
php artisan bundle:install charisma

Categories