Dependencies #
This e-book relies on basic libraries, which will make your coding easier:
- hashids/hashids for hashing integer ids,
- deable/nanoid for secure unique string ID generation,
- deable/encore for building of TypeScript and scss files,
- league/flysystem for storage abstraction.
lando composer require hashids/hashids
lando composer require deable/nanoid
lando composer require deable/encore
lando composer require league/flysystem
Functional Collections #
In some cases, functional code is more suitable and clear. It can handle complex changes of data with a simpler code and a fluid interface. This approach is used in Laravel framework, and also the library to handle collections functionally is provided as a library from Laravel framework community.
Use package illuminate/collections to simplify your code.
lando composer require illuminate/collections
Older versions are available as a library in tightenco/collect. However, this package is deprecated and in the future it will not be maintained.
Model Layer (ORM) #
For object relation mapping (ORM) use Nextras ORM. Nextras Orm is the next generation Orm designed for efficiency and simple usage. It is highly customizable, you can use many extension points. Orm supports MySQL, Postgres or MS SQL Server.
- nextras/dbal for database abstraction layer, query builder, etc.
- nextras/orm for definition of your model layer – entities and relations between them,
- nextras/migrations for database migrations.
lando composer require nextras/dbal
lando composer require nextras/orm
lando composer require nextras/migrations
Don’t forget to remove Nette Database
lando composer remove nette/databaseNette Database is not suitable to use for production environment. This says even the main developer of this package. It is not suitable for bigger projects, because it is too much tied up with database structure. Refactoring of such project is then almost impossible.
It uses advanced caching to keep info about each query, where and when fetch a given set of columns. However, this solution makes a huge amount of cache files, which will make cleaning your cache really difficult.
In many cases, Doctrine is used as a replacement. However, this solution ends in many query builders across your application. Therefore we recommend Nextras ORM. If you use it as it was designed, your application will be lightweight and clear.
Nette Extensions #
- contributte/console or deable/console for console commands,
- contributte/translation for translations,
- nextras/datagrid for datagrid component.
lando composer require contributte/console
lando composer require contributte/translation
lando composer require nextras/datagrid
Additional Libraries #
- symfony/intl
- dragonmantank/cron-expression
- brick/phonenumber
- tuupola/base58
- tuupola/base62
- elasticsearch/elasticsearch
- intervention/image
lando composer require symfony/intl
lando composer require dragonmantank/cron-expression
lando composer require brick/phonenumber
lando composer require tuupola/base58
lando composer require tuupola/base62
lando composer require elasticsearch/elasticsearch
lando composer require intervention/image