R
R
Roman2019-03-10 10:44:10
Composer
Roman, 2019-03-10 10:44:10

How to properly install a library in Laravel via Composer (on a specific example)?

Hello.
I found on Github a library for generating identicon and they write there on installation:

The recommended way to install Identicon is through composer.
Just add the library to your project:
composer require yzalis/identicon

Can I run this command from the root folder with Laravel? She won't rub anything on me?
Do I need to register it somehow there as a service?
And further:
Create a new Identicon object.
$identicon = new \Identicon\Identicon();

Somehow it’s not entirely clear - is it to me that it will be installed in a separate folder in the root of Laravel?
Is there any way to change the installation directory?
I understand that the questions are stupid - but I don’t understand anything about this composer - I want to understand this example a little now. I so understand that all packets are put approximately equally yes?
This package: https://github.com/yzalis/Identicon
Thanks!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Filippenko, 2019-03-10
@procode

that's right, just run composer require yzalis/identicon at the root of the project.
The composer adds packages to the vendor folder, and the class is connected automatically using the autoloader.
Sometimes you need to execute additional commands, for example, to create middleware, or register services, but this is written in the instructions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question