Answer the question
In order to leave comments, you need to log in
SQLSTATE[08006] fe_sendauth: no password supplied?
Not sure what exactly is throwing this error:
###> doctrine/doctrine-bundle ###
DATABASE_URL=postgresql://homestead:[email protected]:54320/test
###< doctrine/doctrine-bundle ###
public function index()
{
// you can fetch the EntityManager via $this->getDoctrine()
// or you can add an argument to your action: index(EntityManagerInterface $em)
$em = $this->getDoctrine()->getManager();
$product = new Product();
$product->setName('Keyboard');
$product->setPrice(19.99);
$product->setDescription('Ergonomic and stylish!');
// tell Doctrine you want to (eventually) save the Product (no queries yet)
$em->persist($product);
// actually executes the queries (i.e. the INSERT query)
$em->flush();
return new Response('Saved new product with id '.$product->getId());
}
doctrine:
dbal:
default_connection: postgres
connections:
#Postgresql
postgres:
driver: 'pdo_pgsql'
host: 'localhost'
port: '5432'
dbname: 'test'
user: 'homestead'
password: 'secret'
charset: UTF8
default_table_options:
charset: UTF8
collate: utf8_unicode_ci
# dbal:
# # configure these for your database server
# driver: 'pdo_pgsql'
# server_version: '5.7'
# charset: UTF8
# url: '%env(DATABASE_URL)%',
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question