Laravel 5.1 some tutorial.

July 18, 2015 3.2k views
PHP Frameworks MySQL Ubuntu

Hello, i am new in Laravel and in DigitalOcean too :)
I create droplet, install Vesta and after install Laravel 5.1
I have several questions:
1) How i must config database connect to my vesta mysql params.
2) I need .env file and in config/database.php use 'host' => env() or i must use 'host' => 'localhost' (or my ip of the sever) i as this because i install laravel debug panel https://github.com/barryvdh/laravel-debugbar and i get this errors
Cannot add listen to Queries for Laravel Debugbar: SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

i not use homestead, i dont`know what is this. i think its like xamp(lamp/wamp) i use my droplet.
3) Laravel has something like YII gii or CakePHP (code generator from database with relationships) ?
In the terminal i try use command
php artisan make:model User
php artisan make:migration createuserstable
php artisan make:migration addvotestouserstable --table=users

php artisan make:migration createuserstable --create=users
in terminal all succesfully and i see new models, controllers, but in my database - not.

What i want - i want use PHPSTORM 9 and create, edit files and upload to server.

1 Answer

It is finding the database, but denying access for the homestead user.

Homestead is a Vagrant box containing the full Laravel development environment aiming to make it simple to get everything up and running locally. As the Laravel database docs mention, by default the .env file is configured for using Homestead:

By default, Laravel's sample environment configuration is ready to use with Laravel Homestead, which is a convenient virtual machine for doing Laravel development on your local machine. Of course, you are free to modify this configuration as needed for your local database.

In your .env file, you need to specify the username, password, and database as well as your host.

Have another answer? Share your knowledge.