Start

In this tutorial you will learn about the most common aspects of the framework:

  • register new Provider in your App and declare all features

  • create routes for GET, POST and DELETE requests

  • implement Controller actions for all routes

  • configure database connection

  • create new database migration using Migration

  • extend Entity and Record classes for ORM

  • implement Resolver for resolving objects based on request parameters

  • create Form for request validation

  • create Middleware and Afterware as before- and after- request handlers

  • learn about Event and Handler

  • create your first console Command and Job for cronjob

Prerequisites:

  • create your project composer create-project pckg-skeleton,

  • optionally install your frontend dependencies - pnpm i,

  • initialize the project - console project:init

  • bootstrap your app - console app:create

Directory/File organization

Notes:

  • App Foo registers YourVendor\Foo\Provider\MyBaseProvider

  • Provider MyBaseProvider registers:

    • routes from MyController optionally validated by CreateDummy request/form and resolved by Dummy record resolver,

    • console command PrintDatetime

    • LogResolved middleware, LogResponseLength afterware and LogInserting event handler

  • Records and entities are auto-wired or resolved by the framework

App and Provider

Create new provider and register it in your base app class.

Routing

Register a new route in your provider:

Controller and Action

Create a controller and action:

Last updated

Was this helpful?