I'm in trouble with my laradock project: i have downloaded and installed docker and i have successfully completed the setup of my laravel project with laradock. I use php 7, laravel(5.5.14) and the latest version of laradock. I start my project writing in shell:
docker-compose up -d nginx mysql
and all services starts. My env file is:
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=root
DB_PASSWORD=root
But when i try to use the migration with
php artisan migrate
i receive this error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations)
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
My db called homestead is created and it works. In my laravel project, under the migration folder i have 3 files php: create_user_table, create_password_reset_table and create_customer_table( i have wrote this file). I need to create a table in my db called customer with some colums:
Schema::create('customers', function (Blueprint $table) {
$table->increments('id');
$table->string('first_name');
$table->string('last_name');
$table->boolean('azienda');
$table->string('iva');
$table->string('ds');
$table->boolean('fatres');
$table->string('cf');
$table->string('mail');
$table->string('telefono');
$table->integer('sponsor');
$table->string('indinst');
$table->string('civinst');
$table->string('cityInst');
$table->string('capinst');
$table->string('provinst');
$table->string('indf');
$table->string('civf');
$table->string('capf');
$table->string('provf');
$table->string('cityFatt');
$table->timestamps();
});
How can i complete the migration and create the table? Thank you for answer!