composer laravel create project
You are missing a parameter in the command. It should be in this order:
composer create-project [PACKAGE] [DESTINATION PATH] [--FLAGS]
You're mistakingly specifying your local path as the Composer/Packagist package you wish to create a project from. Hence the "Could not find package" message.
Simply make sure you're specifying the Laravel package and you should be good to go:
composer create-project laravel/laravel /Applications/MAMP/htdocs/test_laravel
I also had same problem then I found this on there documentation page
So if you want to create a project by name of test_laravel
in directory /Applications/MAMP/htdocs/
then what you need to do is
go to your project parent directory
cd /Applications/MAMP/htdocs
and fire this command
composer create-project laravel/laravel test_laravel --prefer-dist
that's it, this is really easy and it also creates Application Key automatically for you
There are two simple methods for creating laravel Project
Method 1
composer create-project --prefer-dist laravel/laravel <project-name>
Method 2
laravel new <project-name>
Method 2 might require you to run one extra command
composer global require laravel/installer
if you face 'laravel command not found' error
composer create-project laravel/laravel ProjectName