Question

Laravel 5.1 some tutorial.

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) /home/admin/web/default.domain/public_html/vendor/barryvdh/laravel-debugbar/src/LaravelDebugbar.php#316 Exception SQLSTATE[28000] [1045] Access denied for user ‘homestead’@‘localhost’ (using password: YES) /home/admin/web/default.domain/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php#50 PDOException

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 create_users_table after php artisan make:migration add_votes_to_users_table --table=users

php artisan make:migration create_users_table --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.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

DB_HOST=localhost
DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=mysupersecretpassword