PHPackages                             v-cult/phalcon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. v-cult/phalcon

ActiveLibrary[HTTP &amp; Networking](/categories/http)

v-cult/phalcon
==============

Manage Phalcon's projects using MYSQL with Cli commands - SCRUD on the fly - Rest API - full stack solution

0.3(7y ago)289206[1 issues](https://github.com/corentin-begne/phalconTool/issues)MITJavaScriptPHP &gt;=5.4.0CI passing

Since Jun 15Pushed 4mo ago8 watchersCompare

[ Source](https://github.com/corentin-begne/phalconTool)[ Packagist](https://packagist.org/packages/v-cult/phalcon)[ Docs](https://github.com/corentin-begne/phalconTool)[ RSS](/packages/v-cult-phalcon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

phalconTool
===========

[](#phalcontool)

This is an alternative to the official [Phalcon Devtools](https://docs.phalcon.io/5.0/fr-fr/devtools).
This tool allows you to manage projects with Phalcon MVC Framework accessing MYSQL.
For Phalcon 4 and php7 use v4 branche, for JavaScript support use javascript branch.

Features
--------

[](#features)

- Create skeleton project application with default User controller.
- Users and Langs/Translations management base.
- Manage multi application/environment.
- Generate models from Mysql database with column map and full relations.
- Internal library Management.
- Full Rest Api.
- Database migration engine and data management.
- SCRUD on the fly with models relations and validations.
- Generate controller/action.
- Generate js/sass/helper templates and builds.

Documentation
-------------

[](#documentation)

[PHP Documentation](https://corentin-begne.github.io/phalconTool/)

Installation
============

[](#installation)

Requirement
-----------

[](#requirement)

- [Phalcon = 5.x.x](https://phalconphp.com/fr/download)
- php = 8.x.x

Using Composer:

```
{
    "require": {
        "v-cult/phalcon": "dev-master"
    }
}
```

Create a Phalcon symlink to application.php in your root project folder:

```
cd /var/www/project/
ln -s vendor/v-cult/phalcon/application.php ./phalcon
```

Or in /usr/bin to be used globally:

```
sudo ln -s /var/www/project/vendor/v-cult/phalcon/application.php /usr/bin/phalcon
```

Quick start
-----------

[](#quick-start)

For all commands, you can specify the environment and application with options `--env=` and `--app=`.
The default values are dev/frontend. You can add any -- option; it will be available as a define in the task.

### Create project

[](#create-project)

```
./phalcon generate:project
```

This command will create the `apps` and `public` directories in the root project folder, initialized with the frontend application.
The document root of the server must be the `public` directory, referring to the [readme.md](https://github.com/corentin-begne/phalconTool/blob/master/templates/project/README.md) file added in the project.
By default, the `api` and `scrud` libraries are not enabled.
You can also create any another app like `backend` for example.

```
./phalcon generate:app backend
```

If you don't need User management, remove `beforeDispatch` from security in `services.php`.

### Generate models

[](#generate-models)

Before generating models, don't forget to modify the `config.php` file in your app folder.
On generation, if the database is empty, it will import `defaultModels.sql` from the `templates` folder.

```
./phalcon models:generate
```

Models will be created from the database with column mapping and all relations.
By default, SCRUD is not activated.
You need to add `api` and `scrud` in the `config.php` file inside the `libraries` array, uncomment path in `SecurityPlugin` to add them in components and add them to the private or public resources.
You are now able to access SCRUD actions for all models.
For example, for User:

```
https//localhost/frontend/scrud/User/read?id=1
https//localhost/frontend/scrud/User/create
https//localhost/frontend/scrud/User/search

```

You can merge all models that have a `hasOne` relation.
For example, if you add the UserProfil table, you can access it like this:

```
https//localhost/frontend/scrud/User UserProfil/read?id=1
https//localhost/frontend/scrud/User UserProfil/create
https//localhost/frontend/scrud/User UserProfil/search

```

This way, you can set up models with `hasOne` relations.
If you don't need User manager remove tables `User` and `PermissionType`.

You can access to models listing:

```
https//localhost/frontend/scrud/

```

### Generate controllers and actions

[](#generate-controllers-and-actions)

You can specify one or more actions associated with the controller.
By default, the views associated with the actions are created, but the option `--no_view=true` blocks this.

```
./phalcon generate:controller home index,test
```

This command will create the `home` controller with the `index` and `test` actions, along with their views.

### Generate forms

[](#generate-forms)

You can generate forms that contain all inputs corresponding to their model field types, param must be a model name.

```
./phalcon generate:form PermissionType
```

### Generate tasks

[](#generate-tasks)

Similar to generating controllers, you can create tasks with multiple actions at once.

```
./phalcon generate:task video convert,purge
```

Once created, these tasks can be accessed like any other task.

```
./phalcon video:purge
```

### Generate Sass and Js

[](#generate-sass-and-js)

The asset manager sets default collections for CSS and JS.
There is a main CSS file that should be generated compiling Sass and two JS files (main and manager).
The main file is the entry point for each collection.
These collections are included in the default layout.
You can generate these files for each controller/action, and for the index, it will be placed in the root folder.
You can also generate global JS helpers.
Use an empty action for index.

```
./phalcon generate:scss home ,test
./phalcon generate:js home ,test
./phalcon generate:js helper form
```

You can compile all Sass globally or for a specific controller/action, use empty action for index.
If you specify the `prod` environment, the path will be modified by the first CDN configured, and the version will be updated from `config.php`.
Js gnerated are `ES6` modules, you can use importmap, you need to create a `importmap.json` inside the `public` folder, file is used on dev environment and to resolve paths on build.

```
./phalcon generate:sass
./phalcon generate:sass home
./phalcon generate:sass home ,test
./phalcon generate:sass --env=prod
```

### Generate Js build

[](#generate-js-build)

You can generate a JavaScript build file for each controller/action or globally, use emepty action for index.

```
./phalcon generate:build home ,test
./phalcon generate:build home
./phalcon generate:build
```

This command will generate a `build.mjs` file in the action directory, which will be automatically used in the production environment.

### Translation

[](#translation)

Inside each view, you can use `$t->_`or `$t->__` to get translations from keys inside the array from the `messages` folder.
The language used corresponds to the browser language, using `en` as the default.
`$t->_` is more specific and allows access to the translations within the controller/action context.
The translation functions are accessible from the controller, so inside the action, use `$this->__` and `$this->_` to access to the translations.

```
// View inside controller user action login
$t->_('hi') // $messages['hi']
$t->__('hi') // $messages['user_login_hi']
```

You can use SCRUD to manage translations using the `LangMessage` default table or directly un files inside `messages` folder.
Use the task to import (files to database) or export (database to files) data:

```
./phalcon message:import
./phalcon message:export
```

### Migration

[](#migration)

The migration system is based on annotations and modifications made in the models.
It reports the differences from the database.

```
./phalcon migration:generate
```

Once generated, you can run the migration.

```
./phalcon migration:run
```

Running this command will execute all the migrations from the current version (env\_version inside `migrations` folder) to the last one.
You can also roll back one migration at a time.

```
./phalcon migration:rollback
```

Or roll back until a specific version.

```
./phalcon migration:rollback 1
```

You can also create a model template.

```
./phalcon generate:model test
```

### Data Export

[](#data-export)

Run this command to export tables from the database.
If you leave the parameter empty, all tables will be exported.
Tables will be exported as CSV files in the `dumps` folder.

```
./phalcon data:export User
```

### Data Import

[](#data-import)

All CSV files in the `dumps` folder will be imported. Add the `truncate` option to truncate tables before importing.
Otherwise, it will perform a replace based on the primary key.

```
./phalcon data:import --truncate
```

### CDN

[](#cdn)

You can configure CDN URLs in the `config.php` file.
Typically, CDN URLs are only used for the production environment.
If you don't need or want to remove this functionality in the services.php file, leave an empty folder.

### Make a release and send to env server

[](#make-a-release-and-send-to-env-server)

There's a task made for this purpose, you just need to specify the environment.
You can configure it in the `config.php` file by setting the private key, args, excludes, login, and server.
In the preprod and prod environment, it will compile Sass and build JS before sending the files using rsync.

```
./phalcon release --env=prod
```

### Libraries

[](#libraries)

You can add your own libraries by placing them inside the `libraries` folder.
Libraries can include controllers, config files (loader, router), views (layouts, partials, views), and public data.
Once added, simply include them in the `config.php` file within the `libraries` array.

### CLI

[](#cli)

The CLI (Command Line Interface) has default services with MySQL, but you can define your own by creating a file named `services_cli.php` inside the `config` folder.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance51

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~628 days

Total

5

Last Release

1109d ago

Major Versions

0.3 → v3.x-dev2020-02-26

v3.x-dev → v4.x-dev2023-05-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3e7f83682b4ed087fc551411ecf19af42f63356198723b7b43d96803670703e?d=identicon)[Bennette](/maintainers/Bennette)

---

Top Contributors

[![corentin-begne](https://avatars.githubusercontent.com/u/4975024?v=4)](https://github.com/corentin-begne "corentin-begne (331 commits)")

---

Tags

apiclirestmysqlwebsockettoolsassSkeletonphalconfull stackscrud

### Embed Badge

![Health badge](/badges/v-cult-phalcon/health.svg)

```
[![Health](https://phpackages.com/badges/v-cult-phalcon/health.svg)](https://phpackages.com/packages/v-cult-phalcon)
```

###  Alternatives

[marcelgwerder/laravel-api-handler

Package providing helper functions for a Laravel REST-API

16092.6k](/packages/marcelgwerder-laravel-api-handler)[maurobonfietti/rest-api-slim-php

Example of REST API with Slim PHP Framework.

3061.7k](/packages/maurobonfietti-rest-api-slim-php)[maurobonfietti/slim4-api-skeleton

Useful skeleton for RESTful API development, using PHP and Slim 4.

1392.3k](/packages/maurobonfietti-slim4-api-skeleton)[redound/phalcon-rest-boilerplate

Phalcon REST Boilerplate to use with Phalcon REST library

942.9k](/packages/redound-phalcon-rest-boilerplate)[phrest/api

REST API Package for Phalcon PHP

304.2k](/packages/phrest-api)[gte451f/phalcon-json-api-package

A set of tools designed for use in a Phalcon application to make a RESTish API

372.7k](/packages/gte451f-phalcon-json-api-package)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
