How to install Laravel's Artisan?

前端 未结 5 1744
春和景丽
春和景丽 2021-01-30 10:06

I want to create migrations in Laravel but according to the tutorials I need the Artisan CLI. The php command works fine and I\'m on Windows. I type in php ar

5条回答
  •  日久生厌
    2021-01-30 10:39

    You just have to read the laravel installation page:

    1. Install Composer if not already installed
    2. Open a command line and do:
    composer global require "laravel/installer"
    

    Inside your htdocs or www directory, use either:

    laravel new appName
    

    (this can lead to an error on windows computers while using latest Laravel (1.3.2)) or:

    composer create-project --prefer-dist laravel/laravel appName
    

    (this works also on windows) to create a project called "appName".

    To use "php artisan xyz" you have to be inside your project root! as artisan is a file php is going to use... Simple as that ;)

提交回复
热议问题