I'm aware of the other questions out there, but they are different to my situation.
I installed a fresh copy of my own laravel, and I tried running php artisan list
, which works.
Now, I have a colleague who has installed a copy of laravel himself, and he pushes his entire directory onto a git repository. I pulled the entire branch off the repository, and tried running php artisan list
, but nothing happens this time. I mean, literally, nothing happens.
Any ideas as to why this is happening?
Just to point out some thing to anyone struggling with artisan, as this answer is 1st link in google to artisan CLI empty line:
It will print blank line whenever some error happens, even if you have all dependencies installed with
composer install
. And it won't tell you exactly what is wrong. I couldn't figure it out until I put into artisan file in the root directory this:That forced artisan CLI to show error message and therefore I was able to fix it (my .env file was broken).
Hope this helps someone.
In my case problem was to connect artisan with database (migrates) i.e. the command
was not working.
I was running laravel project on 8888 port. In this case I updated .env file as: DB_HOST=localhost to DB_HOST=localhost to
DB_HOST=127.0.0.1
and DB_PORT=3306 toDB_PORT=8889
Cleared cache by running artisan command and run the migrates:
Generally speaking, the
vendor
directory is not committed to VCS, as such, doing a clone on a standard Laravel app won't include all its dependencies.Once you have cloned, doing
composer install
(orcomposer update
if you want the latest packages as a developer) will fetch the dependencies and allow your app to work.You need to run
composer install
, so the composer refresh all dependencies, artisan's begin on the middle. That should do the job!delete the your php at your system , and install it again or if you run the app, move project folder at
htdocs
in xampp folder and type address in browser ,localhost/your project name
and your app is run on localhostMy artisan was not working because i had the following lines in my routes.php
I simply commented the exit(). So my code becomes as follows