laravel command not found while using laravel command - php

I've recently installed composer and also installed laravel installer from composer from the commmand line just like they said in laravel documentation.
But when I used the laravel command on the command line, it show error:
sh.exe": laravel: command not found
I also added environment variable in the path variable.
~/.composer/vendor/bin
But still the same error occurs while using the laravel command.
I'm a laravel newbie and I'm stuck in laravel installation.I've searched lot of times but still could not get the solution. I've read lot of users' questions with the same problem and used their solutions but still could not fix this.

Your path /c/xampp/php:~/.composer/vendor/bin is definitly wrong. Either you have to fix it (should be something like C:/{path_to_your_composer_directory}) or you can simply use composer create-project laravel/laravel --prefer-dist to install a new laravel project.
I would go with the 2nd option, because you don't have to configure something else.

On windows system, please remove . from path (just before .Composer)

Related

Interface 'Monolog\ResettableInterface' not found when running a new project

Whenever I try to run any command related to php artisan or composer this error shows up:
PHP Fatal error: Interface 'Monolog\ResettableInterface' not found in path\to\project\root\vendor\monolog\monolog\src\Monolog\Logger.php on line 28
I open the file, and it points me to :
class Logger implements LoggerInterface, ResettableInterface
I try to find the Logger interface and it's there.
I really can't find any other solutions and the ones recommended here by SO are outdated.
I use laravel 5.7 running composer version 1.8.0 on a xampp server with PHP 7.2.10 on Windows 10
Please feel free to ask more questions and I'll try to answer them without ruining my NDA.
Update: it works now thanks to that one person who answered.
If anyone needs this solution, you can do what Saumini Navaratnam suggested; removing the vendor folder and running composer update on the root folder. I, myself found another solution that might work and it is: running composer update --no-dev as the ResettableInterface came from a dev dependency. Weird, but it works fine now.
Again this works only on Laravel 5.7, at least for now.

Laravel - Reportico not working

I am using Reportico reporting module, and follow the installation instructions listed on official website, but somehow its not working.
Here are the steps I followed:
I have created a fresh laravel project mentioned on laravel docs:
composer create-project --prefer-dist laravel/laravel blog
Then within the project root directory, I executed the following command by using composer:
composer require reportico/laravel-reportico "~5.2"
And remaining steps are same as listed on Reportico website. It did not give me any error message in the steps, but finally when I go to the url:
http://localhost:8000/index.php/reportico
It is showing error message that route not found.
Can anybody suggest how to fix this, or is there any free-open-source reporting tool which I can use with Laravel project.
This project was upgraded to 5.4 in February, but unfortunately there was a problem which made it unavailable to the world. I believe I have fixed this now so please retry the composer require command and you should get version 5.4 of the package.
If it doesnt work you could try using the following instead to force the version update:
composer require "reportico/laravel-reportico" "dev-master"
Also, the error messsage you are getting implies you havent added to your config/app.php file in the providers section
Reportico\Reportico\ReporticoServiceProvider::class
This is very important. Please let me know if this works.
Peter
I had the same issue.
Changing the url to below worked for me
http://localhost:8000/index.php/reportico
Hope it helps someone.

how to run a github pulled project with laravel?

i just cloned a project from bitbucket with sourcetree. Now i am trying to run it with laravel. I started my cmd with administrator rights and i am in the right directory of the project. Now when i try to do the 'composer update' command i get this error in my command line :
i know this topic was been discussed before but i couldn't find the answer in them for me. This must have something to do with the fact that me and my friend are making this laravel project together and we are using source tree with bitbucket as a version control system , he can run the project on his computer but when i pull it , it stopped working. Is there annything i need to keep in in mind when using laravel with git ?
I had the same problem when i cloned the repository from github.
what id did is
Composer Install
using the terminal in my app directory. It worked A1!
hope this helps
You may have to use composer install because laravel by default exludes the following directories from git:
/vendor
/node_modules
.env
Which could be causing your error
Another similar question was asked here covering the same error: Laravel 4: Fatal error: Class 'Patchwork\Utf8\Bootup' not found in autoload.php

Laravel setup project file fails

I've searched many answers to this problem, and a alternative solution to this project to still get what I try to achieve, but I want to know why it is not working the 'regular' way, and if it is possible to fix it somehow. I checked out this post where I found my alternative solution.
I installed laravel and I'm trying to create a project with laravel. However, when I run this command
composer create-project laravel/laravel cms
I get the following error: [InvalidArgumentException] - Composer could not find the config file
I followed all installation settings via a tutorial, created the composer enviroment variable, so those settings should be correct. Does somebody know why this is not working and how I might be able to fix this?
Edit: To clarify, as Joe commented, composer commands do work.
first, run the following command:
composer global require "laravel/installer=~1.1"
then, add ~/.composer/vendor/bin to your PATH. this way your system knows where the laravel installer is.
When this is done, you can simple use the following command to make a new project:
composer create-project laravel/laravel --prefer-dist
I had this problem myself since i was used to use composer to init a laravel project. However, after setting up this installer, i honestly love it. It has a bunch of neat options you can use ;-)
For more info, look here

Laravel 4 /Composer Install Error

I was following a noobies guide to Laravel, but sadly I am stumped on step one..
I have tried many threads relating to the same thing, but none seem to work - and I am stumped.
I have followed to the letter, this helpful video, and never diverted in any detail.
https://www.youtube.com/watch?v=JNn_tS2KpcY
For example I have changed all the required extension=php_openssl.dll's mentioned in posts such as this:
https://stackoverflow.com/questions/16940582/laravel-4-composer-error/16940691#16940691
As you might expect I am very new to coding, so I have provided images to help illustrate things I am not too sure about.
Firstly I download and install the .phar file, and my folder structure and files look like:
This is setup globally I assume? I also have the PATH variables added correctly when the installation prompts to add them.
So next I run composer in my command line, and successfully receive:
This to me, indicates Composer is installed at least?
Ok, next I make a folder in my WAMP server, and copy the contents from "Laravel-Master", which is from Laravels GIT and quick start guide:
Next I cd to the www folder and run the command:
composer create-project laravel/laravel your-project-name --prefer-dist
Things seem to go fine, and it does make a new Laravel "project-name" (if the folder is empty)
but then errors:
Composer could not find the config file: c: programdata\composer setup\bin To initialize a project, please create a composer.json file.
This is most annoying as I stick very close to the video linked above, but do not get the same results.
Thanks very much for your time.
Your Composer installation is misconfigured (or rather un-configured.) I don't know what that video says about installing Composer however I would download an installation executable here for Windows and follow the instructions.
If you have done this, great! However something got screwed up in the installation process, so you should try running the same installer again.
According to this and this, you could also try this command instead:
COMPOSER=composer.json composer create-project laravel/laravel your-project-name --prefer-dist
You would be better suited with Laravel Homestead, which already comes with everything you need to run Laravel in a Vagrant Box
http://laravel.com/docs/4.2/homestead

Categories