Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Laravel's Artisan?

Tags:

php

laravel

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 artisan or php artisan list and I get the following error:

Could not open input file: artisan

I wasn't able to find any guide in the documentation nor in Google. How can I install Artisan?

like image 890
totymedli Avatar asked Jan 17 '14 00:01

totymedli


People also ask

Apa itu framework laravel?

Laravel merupakan framework yang dapat membantu web developer dalam memaksimalkan penggunaan PHP dalam proses pengembangan website. Seperti diketahui, PHP sendiri merupakan bahasa pemograman yang cukup dinamis. Dimana kehadiran Laravel kemudian membuat PHP menjadi lebih powerful, cepat, aman, dan simple.

Apa itu Composer pada laravel?

Untuk menginstall Laravel, kita disarankan memakai aplikasi Composer. Composer merupakan sebuah aplikasi package manager untuk menginstall berbagai file PHP, terutama library dan framework yang dibuat menggunakan PHP.

Laravel 8 itu apa?

Laravel adalah framework PHP yang bersifat open source dan dirancang agar proses pengembangan aplikasi web menjadi lebih mudah dan cepat karena berbagai fitur bawaan di dalamnya.


1 Answers

Use the project's root folder

Artisan comes with Laravel by default, if your php command works fine, then the only thing you need to do is to navigate to the project's root folder. The root folder is the parent folder of the app folder. For example:

cd c:\Program Files\xampp\htdocs\your-project-name 

Now the php artisan list command should work fine, because PHP runs the file called artisan in the project's folder.

Install the framework

Keep in mind that Artisan runs scripts stored in the vendor folder, so if you installed Laravel without Composer, like downloading and extracting the Laravel GitHub repo, then you don't have the framework itself and you may get the following error when you try to use Artisan:

Could not open input file: artisan

To solve this you have to install the framework itself by running composer install in your project's root folder.

like image 199
totymedli Avatar answered Sep 28 '22 08:09

totymedli