从laravel项目的角度来看,工匠和作曲家之间有什么区别?

I didn't know composer before laravel and i encountered them at the same time. So, I can't distinguish the commands of them, but memorize them.

What is the difference between php artisan and composer.phar and also the commands they run?

Can anyone help me on this issue? Thanks..

Composer is a package manager for php and artisan is a command line tool using php

Composer - download libraries

Artisan - run scripted commands like you would in bash

The reason to use artisan instead of direct php commands is that you have to implement certain functions so you get an universal feel to the commands. It will help with a lot of things like handling arguments. You could see it as a nice helper for writing great php command line tools.

Once your command is generated, you should fill out the name and description properties of the class, which will be used when displaying your command on the list screen.

The fire method will be called when your command is executed. You may place any command logic in this method. https://laravel.com/docs/5.0/commands

There is a basic difference in these two commands that they belongs to two different packages.

Composer: composer is a dependency management tool for php. It auto manages dependencies of your project according to your requirements and thus makes your project more distributable.

You don't have to package all the dependencies inside your application. And, if your dependencies are variable it is hard to manage them all within your application. So, composer does it for you.

So, your composer command operates this package. And, it can be used for any project whether it is laravel or other php application.

Artisan: This is the command line utility of Laravel. It comes integrated with your laravel installation.

You can perform operations on your laravel project using its commands. As it is a tool built over php. So, you need to execute its command over php-CLI. That is why you use the php before it.

And, you need to use artisan before it because this is the script name which operates the commands of this tool. If you see your laravel project directory it has a file named artisan inside the root folder. It is the file which bootstraps the laravel's command line code. Or, you can say it is like index.php of directory.

Hope I was helpful.