democrito88 / demovel
Library that create a structure of a simple PHP project on MVC achitecture.
Requires
- doctrine/annotations: ^1.0
- doctrine/dbal: ^3.2
- doctrine/migrations: ^3.6
- doctrine/orm: ^2.16
- firebase/php-jwt: ^6.8
- phpmailer/phpmailer: ^6.8
- symfony/cache: ^6.3
- symfony/filesystem: 7.2.x-dev
- symfony/flex: ^2.4
- symfony/yaml: *
- vlucas/phpdotenv: ^5.6@dev
This package is auto-updated.
Last update: 2025-06-28 04:22:55 UTC
README
Library that create a structure of a simple PHP project on MVC achitecture. It uses Symfony libraries as dependencies such as Doctrine.
Usage
Create a new project
To create a new project, install this package and run the command:
composer install
./bin/console create:new <my-new-project>
It will create a project with the following structure:
root-folder
├──public
| └──index.php
├──src
| ├──Provider
| | └──EntityServiceProvider.php
| ├──Controller
| | ├──InterfaceController.php
| | ├──Controller.php
| | ├──UserController.php
| | └──TokenController.php
| └──Entity
| ├──Entity.php
| ├──User.php
| └──Token.php
├──routes
| ├──router.php
| └──routes.php
├──.env
└──.htaccess
Create migration basic structure
./bin/console attach:migration
This command will create the basic structure for create and run migration classes as it follows:
root-folder
└──database
└──migrations
├──CreateTable.php
├──CreateUsersTable.php
└──runMigrations.php
All migration classes must extend CreateTable class and be mentioned in runMigrations.php script.
Create seeding basic structure
./bin/console attach:seeding
This command will create the basic structure for create and run seeding classes as it follows:
root-folder
└──database
└──seed
├──Seeder.php
├──UsersSeeder.php
└──runSeeders.php
All seedeing classes must extend Seeder class and be mentioned in runSeeders.php script.
Create a mail class
./bin/console attach:mail
It will create the Sender.php file inside a Email folder as it follows:
root-folder
└──src
└──Email
└──Seeder.php
This package uses PHPMailer to send an email.
Create new Entity
.bin/console new:entity <name>
This command will create a new Entity class in the src/Entity
directory. You just need to pass the name parameter.
This projects uses Dorctrine ORM annotations in its Entities.
Create new Controller
.bin/console new:controller <name>
This command will create a new Controller class in the src/Controller
directory. You just need to pass the name parameter.