Installing Laravel Voyager admin panel
The correct procedure
I have recently had a couple of small problems installing the Laravel Voyager admin panel. It works specifically with Laravel 5.3 and this can be a disadvantage. If you use Voyager, probably you will not upgrade your Larvel installation or you will have a lot of troubles if you do it! But don't worry: Laravel 5.3 is great and you can have a lot of features available for your project. Let's see the correct procedure and how to install Voyager correctly from scratch.
Install Laravel 5.3 forcing the specific version with composer;
composer create-project --prefer-dist laravel/laravel laravel-voyager "5.3.*"
Now you have a new directory with all your files including the vendor directory. Go inside this directory and install Voyager:
composer require tcg/voyager
Now let's update the .env file on the root of our project with the correct database parameters. I am connecting to a MySQL database.
Add the two class reference to the Laravel configuration. The file is config/app.php;
'providers' => [
Now install voyager applying all settings with the Laravel artisan command:
php artisan voyager:install
php artisan vendor:publish --tag=voyager_assets --force
Here comes a new problem. They say you must have a user on your database table but my user table was empty!
Let's create a new admin user with the same artisan command:
php artisan voyager:admin email@example.com --create
You can run the installation with some dummy data:
php artisan voyager:install --with-dummy
In this case, your username and password will be the same as below.
Raise your web server:
php artisan serve
Visit your admin login page:
Login with your username and password. I have created a user with these credential:
That's it! Now you have your correct Voyager admin panel installed. This tool is great but it doesn't have a good CRUD generator like the amazing Gii for Yii 2. You to install your own generator but I think Gii is better anyway because you can use different tools without adding any external dependency.