Z
Z
zzmaster2019-03-22 03:17:46
Composer
zzmaster, 2019-03-22 03:17:46

How to install Voyager admin (Laravel)?

I'm new to lara, I don't seem to understand something.
Here is the instructions for installing voyager
https://github.com/the-control-group/voyager
It is clear that you first need to install Laravel itself, ok, I am creating a blog project

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

it happens at the root of the domain.
Further according to the instructions
composer require tcg/voyager

which is immediately alarming - a separate vendor folder appears in the root plus the blog / vendor folder, okay, according to the instructions, I go to blog / .env (because it doesn’t exist at the root) and configure access to the database. Further
php artisan voyager:install

does not find any artisan at the root, so I do this from the blog folder.
After that, the admin panel opens at /blog/public/admin, BUT all links in the admin menu go from the root, for example /users - and, of course, do not work.
I thought about it and thought that maybe the blog project is not relevant if the voyager project is installed, I tried installing laravel using the second option
composer global require laravel/installer

Laravel was installed somewhere deep into the server and already the second point of the instruction (setting up env) became impossible, because there was no .env in the folder.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FernandoErrNando, 2019-03-22
@zzmaster

In short, almost everything is a bit wrong:
1. In the installation doc you say: After creating your new Laravel application you can include the Voyager package with the following command:
This command needs to be run in your laravel project folder, in your case blog
2 In the same blog folder, you need a configured .env file, if it is not there, you just need to copy .env.example and save it under the name .env, edit the connection to the database and other parameters you need in it and everything will go fine.
3.

composer global require laravel/installer
and why do you need this? You installed it anyway, it's just another way to create a project.
4. Well, yes, you need to configure the server config, as indicated in the Laravel installation documentation ( https://laravel.com/docs/5.8/installation):
After installing Laravel, you should configure your web server's document / web root to be the public directory. The index.php in this directory serves as the front controller for all HTTP requests entering your application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question