0

Using laracasts I was able to install a new Laravel project by typing in laravel new project-name into the console and it will install a new Laravel install. I was looking to have the same functionality with WordPress. I found a few tutorials that mentioned that said to install WordPress with composer I would have to put a composer.json file in the folder I want to install WordPress in with

{   "require": {
    "johnpbloch/wordpress": "*"   } }

I'm trying to figure out a way to set it up so I can just type in wordpress new project-name and composer will create a folder using that name with a blank WordPress install. I'm guessing maybe I would use an alias?

1 Answer 1

0

laravel new project-name is probably a shortcut for composer create-project --prefer-dist laravel/laravel project-name. It basically uses laravel/laravel package as a project template and initializes your app using it as a starter. If you want similar functionality for WordPress, you need to find project template for Wordpress. You may try Bedrock as am example, but there are also other starters for WordPress:

composer create-project roots/bedrock project-name

If you really want to use wordpress new syntax, you should probably create custom wordpress command which will call composer create-project internally. But I would not recommend that, it does not give much benefits, just hides what is really happening.

1
  • Gotcha, I will check out Bedrock. Thanks!
    – chris
    Feb 18, 2019 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.