How to fix (Could not open input file: artisan) error in laravel

You cannot use PHP artisan if you are not inside a Laravel project folder.

That is why it says, ‘Could not open input file – artisan.’

You need first to create a Laravel project, and if you already have one, you need to go to this project dir using the cd command in the terminal, for example, cd myproject.

Now you will be able to run any artisan commands; for example, running PHP artisan will display your list of available commands.

Source: https://laravel.com/docs/8.x/installation