After creating a project by typing
laravel new "first-project"
I am writing the below code but is causes an error
php artisan serve
Could not open input file: artisan
After creating a project by typing
laravel new "first-project"
I am writing the below code but is causes an error
php artisan serve
Could not open input file: artisan
The laravel new [project name]
command creates a new project in a subdirectory. You need to cd into that subdirectory.
laravel new "first-project"
cd first-project
php artisan serve
From the installation documentation:
the
laravel new
command will create a fresh Laravel installation in the directory you specify. For instance,laravel new blog
will create a directory namedblog
containing a fresh Laravel installation with all of Laravel's dependencies already installed
Perhaps you would like to make the current working directory the directory that was just created for the project you just created.
"You need to be inside first-project folder .."
You need to first create Laravel project and if you already have one you need to go to this project dir using cd
command in terminal for example
cd first-project
Now you will be able to run any artisan commands, for example running
php artisan
will display you list of available commands.