4

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

Screenshot

0

3 Answers 3

4

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 named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed

Sign up to request clarification or add additional context in comments.

Comments

1

Perhaps you would like to make the current working directory the directory that was just created for the project you just created.

1 Comment

Wow, 2nd place for 3 seconds. :D
0

"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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.