Download the PHP package bornfight/maboo-maker-bundle without Composer

On this page you can find all versions of the php package bornfight/maboo-maker-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package maboo-maker-bundle

Maboo Maker Bundle

Boilerplate code generator for projects with layered architecture

Installation

To install this package, use Composer:

If you are using Symfony Flex, this will install and enable the Maboo Maker bundle automatically.
If not, you should add this manually to your config/bundles.php file:

Usage

There are multiple commands available which can work independently, but whenever possible, you can make your life easier just by running:

List of currently supported sub-commands:

make:maboo-scaffold will start the interactive wizard and ask you which of the components you need and then internally execute all selected commands one by one.

Happy path

Generating a new entity with scalar types for fields

  1. Run bin/console make:maboo-scaffold
  2. Follow the interactive wizard:
    1. Select all available options (this is the default so just press ↵ Return to confirm)
    2. Select an existing module or create a new one. Existing folders within project source directory (src/) are suggested, so you can use ⇥ Tab for autocompletion.
      Example: Booking
    3. Type entity name (for now, existing entities are also suggested when you start typing, but updating is currently not supported).
      Example: Hotel
      This creates a class in src/Shared/Infrastructure/Persistence/Doctrine/Entity
    4. All classes will have this entity name suggested, but you can overwrite any of those. If you would like to keep the defaults, just confirm it by pressing ↵ Return:
      1. Domain model name: Hotel
        This creates a class in src/Booking/Domain/Model
      2. Entity mapper name: HotelMapper
        This creates a class in src/Shared/Infrastructure/Persistence/Doctrine/Mapper
      3. Write model names: CreateHotel and UpdateHotel
        This creates classes in src/Booking/Domain/WriteModel
      4. Repository interface and class names: HotelRepository and DoctrineHotelRepository
        This creates an interface in src/Booking/Domain/Repository and a class in src/Booking/Infrastructure/Persistence/Repository
      5. Basic specification interface and class names: IsExistingHotelSpecification and DoctrineIsExistingHotelSpecification
        This creates an interface in src/Booking/Application/Specification and a class in src/Booking/Infrastructure/Specification
      6. Validator name: HotelValidator
        This creates a class in src/Booking/Application/Validator
      7. Manager name: HotelManager
        This creates a class in src/Booking/Application/Manager
      8. Resolver name: HotelResolver
        This creates a resolver class in src/Booking/Infrastructure/GraphQL/Resolver
      9. Mutation name: HotelMutation
        This creates a mutation class in src/Booking/Infrastructure/GraphQL/Mutation
      10. Fixtures name: HotelFixures
        This creates a fixtures class in src/Booking/Infrastructure/Persistence/DataFixtures
    5. Add fields:
      Example: name (string, 255, non-nullable), isOpen (boolean, non-nullable), address (string, 255, non-nullable), longitude (float, nullable), latitude (float, nullable)
    6. Press ↵ Return one more time.
  3. Generate and apply migrations (these are Doctrine commands and have nothing to do with the generator):
    1. bin/console make:migration
    2. bin/console doctrine:migration:migrate
  4. Add some meaningful data to the fixtures or just load dummy data pregenerated based on field types:
    1. bin/console doctrine:fixtures:load
  5. Generate GraphQL schema:
    1. Run bin/console make:maboo-gql-schema
    2. Select the module (Booking) and the entity you've just generated (Hotel)
      This updates existing Query.types.yaml and Mutation.types.yaml files in directory /config/graphql/types.
      This also creates GraphQL input, payload and type schema files in src/Booking/Infrastructure/Resources/config/graphql/types
  6. 🚀 All done!

Now try running a query in your favourite GraphQL GUI:

You should get something like:

It works!

Try running a mutation (by default, you must have admin rights):

The response should contain the ID of the newly created hotel:

Motivation

This bundle should make creating a bunch of files with a bunch of boilerplate code a cinch.
Copy-pasting existing entities and models and then renaming just some fields can be cumbersome and error-prone task. It is also time-consuming task and makes you feel like a code monkey. We use some strict rules and instead of looking for analogies in existing classes and lots of manual work, this generator does that for you.

The very implementation was heavily influenced by Symfony's Maker Bundle. Some parts of the code in it are literally a copy-paste because mentioned bundle has classes declared as final which makes it impossible to extend them and overwrite just some parts of the logic.


All versions of maboo-maker-bundle with dependencies

PHP Build Version
Package Version
Requires php Version 8.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bornfight/maboo-maker-bundle contains the following files

Loading the files please wait ....