Skip to content

Kevingili/crud_article

Repository files navigation

CRUD Article in Symfony

How to use this project

git clone ...
cd ...
composer install
configure your .env (DATABASE_URL="mysql://db_user:[email protected]:3306/db_name")
php bin/console make:migration
php bin/console doctrine:migrations:migrate
php bin/console doctrine:fixtures:load
yarn encore dev
php -S 127.0.0.1:8000 -t public

Tuto

Create project

composer create-project symfony/website-skeleton crud_article

Create an entity

php bin/console make:entity

Create CRUD for your entity

php bin/console make:crud

Configure your database and create one user

mysql -u root
create database databasename
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT ON *.* TO 'username'@'localhost';

Configure your .env

DATABASE_URL="mysql://db_user:[email protected]:3306/db_name"

Prepare your migration

php bin/console make:migration

Insert Entity in database

php bin/console doctrine:migrations:migrate

List of all routes

php bin/console debug:router

Start server

php -S 127.0.0.1:8000 -t public