Skip to content

Reun-Media/php-app-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reun Media PHP app template

A starter template for PHP projects.

Getting started

Create project

This template is not published to Packagist, so use the command below to create a new project.

composer create-project reun/php-app-template myapp --repository="{\"url\": \"https://github.com/Reun-Media/php-app-template\", \"type\": \"vcs\"}" --stability=dev --remove-vcs

Install latest versions of dependencies

cd myapp
pnpm update
composer update

update is used instead of install to update lockfiles to latest versions of dependencies.

Run composer outdated -D and pnpm outdated periodically to check for outdated packages. If there are new major releases of packages out, feel free to submit a pull request.

Start development servers

pnpm dev
composer dev

You must run pnpm dev before composer dev if you want to use the dev server. You can also run pnpm build instead of starting a dev server. See reun/twig-utilities documentation for more info.

Additional information

composer.json package type

The default type for package in composer.json is project. Remove it or change to library if creating a library.

Application root in subdirectory and VS Code extensions

If you use a subdirectory for the application, you should add following configuration to .vscode/settings.json to use PHPStan and PHP CS Fixer extensions (replace app with the app root directory):

// .vscode/settings.json
{
  "phpstan.rootDir": "app",
  "php-cs-fixer.config": "app/.php-cs-fixer.php"
}

Additional setup tasks

  • Change badges to point to your package in Packagist or remove them
  • Add LICENSE

Tip

After initial setup, remove the section above and replace README with the template below.

Show README template

My Project

Supported PHP Version Packagist Version

Short description of the project.

Installation

composer require myorg/mypackage

Configuration

Add configuration steps here.

Usage

Describe how to use the package.

Development

This repository includes a dev container that can be used to launch a development environment.

Run tests:

composer test

Generate code coverage report (see Pest Test Coverage for more):

composer test -- --coverage

Start dev server:

composer dev

Run PHP CS Fixer and PHPStan:

composer lint