Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

2 D铆as
0 Hrs
12 Min
24 Seg
Curso de Bases de Datos en Symfony

Curso de Bases de Datos en Symfony

Profesor Italo Morales F

Profesor Italo Morales F

Configuraci贸n inicial

1/21
Resources
Transcript

What will you learn in this Symfony and databases course?

Programming is constantly transforming, and in this Symfony course we will guide you through the world of databases with a precise and in-depth approach. Throughout this course, you will explore critical topics such as entities, table relationships, relationship types, initial or dummy data loads, and custom queries. While some of these areas may sound advanced, this course is designed to give you a solid and clear understanding, so that you master Symfony in the database area.

How to start the project setup in Symfony?

Starting a project in Symfony may seem challenging, but with the right steps, it becomes a simple and tidy task. Here I will show you how to do it from scratch.

Starting a new Symfony project

To create a new project in Symfony, follow these steps:

  1. Open your terminal and go to the folder where you want to save your project, for example, Sites.
  2. Run the command to create a new project:
    symfony new data
    This will generate a new project called "data".

Stand up the Symfony server

With your project created, the next step is to pull up the server to view your application in the browser:

cd datasymfony serve

Once the server is up and running, you will be able to see the address to access in your browser. This will verify that your project is correctly configured.

Installing additional components for configuration

To facilitate the creation of entities and other elements in Symfony, it is essential to install the Maker Bundle. Use the following command:

composer require symfony/maker-bundle --dev

After this installation, you will have new tools that will simplify the creation of entities, controllers and more.

Database configuration

To connect Symfony with the database, follow the steps below:

  1. Edit the .env file in the root of your project.

  2. Configure the database by selecting the correct driver (in this case, MariaDB) and setting the connection parameters. For example:

    DATABASE_URL="mysql://usuario:contrase帽[email protected]:3306/datos"
  3. If you are using MariaDB, verify the version by running:

    mariadb --version
  4. To create the database, use the command:

    php bin/console doctrine:database:create

If everything is set up correctly, you will see a message confirming the successful creation of the database.

Validating the installation and connection

You have now installed the necessary components and configured the database connection. Make sure that everything is working by reviewing the installation commands and that the database is functioning as intended. Perform tests to ensure that the initial configuration is correct and ready to support application development.

With these items done, you have a solid foundation to move forward in your Symfony learning. We are here to accompany you on this educational journey, so keep exploring and learning!

Contributions 5

Questions 0

Sort by:

Want to see more contributions, questions and answers from the community?

//crear el proyecto symfony new datos //para tener mas comandos en la consola composer require symfony/maker-bundle //para traer el orm de symfony composer require symfony/orm-pack //configurar .env para DB //para crear la base de datos php bin/console doctrine:database:create //historial de los comandos usados history

Ahora bien si quieren instalar la Symfony CLI en Linux:

wget https://get.symfony.com/cli/installer -O - | bash O curl -sS https://get.symfony.com/cli/installer | bash

Si no tenemos installado a Symfony creamos el proyecto con: composer create-project symfony/skeleton:"6.2.*" my_project_directory

estoy trabajando con linux mint y no consigo conectarme a la base de datos, estoy utilizando xampp

Vamos a darle!