tobento/app-skeleton

PHP application skeleton.

1.0.3 2023-12-29 09:21 UTC

This package is auto-updated.

Last update: 2024-10-29 11:23:32 UTC


README

Use this app skeleton to quickly setup and start working on a new App project.

Table of Contents

Getting Started

Add the latest version of the app skeleton running this command.

composer create-project tobento/app-skeleton [my-app-name]

Requirements

  • PHP 8.0 or greater

Documentation

App

Check out the App to learn more about the app in general.

Directory Structure

The directories are set on the app.php file. You can freely change them as you prefer.

app/app.php

Check out the App Directories to learn more about directories in general.

Config

Some App Bundles have config files, which will be located as default at:

app/config/

Src

The app/src/ directory is the place to put your classes which is namespaced under App.

Register Boots

You may register boots on two places.

On the app.php config file

app/config/app.php
return [
    
    /*
    |--------------------------------------------------------------------------
    | Application Boots
    |--------------------------------------------------------------------------
    |
    | The application boots.
    |
    */
        
    'boots' => [
        \Tobento\App\Boot\ErrorHandling::class,
        
        // add more boots.
        AnyBoot::class,
    ],
    
];

On the app.php file

app/app.php
// Boot the app -----------------------------------------------------------
$app->boot(\Tobento\App\Boot\App::class);

// Add more boots here
$app->boot(AnyBoot::class);

App Testing

Unit Tests

Unit tests are designed to test small, isolated portions of code, often focusing on a single method.

See demo test file: tests/Unit/DemoTest.php

Feature Tests

Feature tests test the behavior of a complete application. They may make HTTP requests and test that the response is as expected.

See demo test file: tests/Feature/DemoTest.php

Furthermore, check out the App Testing bundle for more information.

App Bundles

List Of Available App Bundles

Credits