PHP Classes

Beacon: MVC framework with built-in user management

Recommend this page to a friend!
  Info   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2026-06-18 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
beacon 1.4.0Custom (specified...8.5User Management, Libraries, Design Pa..., P...
Description 

Author

This package provides an MVC framework with built-in user management.

It provides classes to implement applications based on the Model-View-Controller design pattern.

The package provides model and controller classes to let applications perform actions to manage user records like registration, login, logout, and password recovery.

Applications may be created using the composer create-project command.

Picture of Steffen Haase
  Performance   Level  
Name: Steffen Haase <contact>
Classes: 1 package by
Country: Malaysia Malaysia

Instructions

Details

Beacon - The Foundation for Modern PHP Applications

Logo with Brand and Slogan

About Beacon

Beacon is a modern PHP application starter framework designed for developers who value simplicity, maintainability, and rapid development.

It combines proven architectural concepts such as dependency injection, service providers, middleware, routing, validation, authentication, database migrations, and Eloquent ORM into a clean, lightweight, and developer-friendly foundation.

Unlike many frameworks that require extensive initial setup, Beacon is distributed as a complete project skeleton, including a fully integrated authentication system with user registration, login, password reset, remember-me functionality, and email verification. This allows developers to focus on building their applications rather than spending time on repetitive boilerplate configuration.

Beacon also includes a lightweight Neumorphism-based CSS starter design featuring commonly used UI components such as cards, buttons, form controls, alerts, and popovers. The design serves as a practical starting point and can be customized or replaced entirely to suit your project's requirements.

Whether you're building a personal website, business application, administration panel, or custom web platform, Beacon provides a solid and extensible foundation to get started quickly.

Features

  • Modern MVC architecture
  • Dependency Injection Container
  • Service Providers
  • Middleware Pipeline
  • Named Routes
  • Twig Templating
  • Eloquent ORM
  • Database Migrations
  • Authentication System
  • Remember Me Authentication
  • CSRF Protection
  • DTO-based Validation
  • Flash Messages
  • Console Commands
  • Environment Configuration
  • PSR-4 Autoloading
  • Docker Development Environment (with HTTPS support)

Requirements

  • PHP 8.5+
  • Composer
  • MariaDB / MySQL
  • Docker (optional)

Installation

  1. Create a new Beacon project:
    composer create-project shworx/beacon my-project
    
  2. Enter the project directory:
    cd my-project
    
  3. Install dependencies:
    composer install
    
  4. Copy the environment configuration:
    cp .env.example .env
    
  5. Generate an application secret:
    php console app:key
    
  6. Copy the generated application secret to the `.env` file (`APP_SECRET`)
  7. Run database migrations:
    php console migrate
    
  8. Start your web server and begin building.

Project Structure

project-directory
??? app
?    ??? Console
?    ?    ??? Commands      // Contains all the Console commands
?    ??? Container
?    ??? Controllers        // Contains all Controllers
?    ??? Database
?    ??? DTO                // Contains all the DTO's
?    ??? Enums
?    ??? Exceptions
?    ??? Helpers
?    ??? Http
?    ??? Interfaces
?    ??? Middleware
?    ??? Models             // Contains all Models
?    ??? Providers
?    ??? Routing
?    ??? Services
?    ??? Support
?    ??? View
??? bootstrap
??? config
??? console
??? database
?    ??? migrations
??? docker
??? public
?    ??? assets
?    ?    ??? css
?    ?    ??? js
?    ?    ??? favicons      
?    ?    ??? img
??? resources
?    ??? stubs
?    ??? views              // Contains all the Twig templates
??? routes
?    ??? web.php            // This is where the routes are defined
??? storage
??? tests

Console Commands

List all available commands: php console<br> Create Migration: php console make:migration create_users_table<br> Run Migrations: php console migrate<br> Rollback Migrations: php console migrate:rollback<br> Generate Application Secret: php console app:key<br>

Routing Examples

Basic routes

// routes/web.php
$router->get('/', [HomeController::class, 'index'], 'home');
$router->post('/', [MyController::class, 'submit'], 'home.submit');

Routes with parameter

// routes/web.php
$router->get('/my-route/{first}/{second}', [MyController::class, 'myMethod'], 'my-name');

// app/Controllers/MyController.php
public function myMethod($first, $second): Response {
    ...
}

Route groups

$router->group(
    prefix: '',
    callback: function (Router $router) {
        $router->get('/dashboard', [DashboardController::class, 'index'], 'dashboard');
    },
    middleware: [AuthMiddleware::class]
);

Generate URLs in Twig:

<a href="{{ route('home') }}">Home</a>
<a href="{{ route('my-name', {'first' : 'first_value', 'second' : 'second_value'}) }}"

Validation

Beacon integrates Symfony Validator with DTO-based validation.

Example:

// app/DTO/LoginDto.php
namespace App\DTO;

use Symfony\Component\Validator\Constraints as Assert;

final readonly class LoginDto
{
public function __construct(
#[Assert\NotBlank]
#[Assert\Email]
public string $email,

        #[Assert\NotBlank]
        public string $password,
    ) {}
}

Validate example:

// app/Controllers/LoginController.php

$dto = LoginDto::fromArray($request->all());
$validator->validate($dto);

Database

Beacon uses Laravel's Eloquent ORM.

$user = User::query()
    ->where('email', $email)
    ->first();

With relation:

$prt = PasswordResetToken::with('user')
    ->where('token_hash', $tokenHash)
    ->first();

Create migrations:

php console make:migration create_posts_table

Run migrations:

php console migrate

Philosophy

Beacon aims to provide:

  • A clean architecture
  • Modern PHP practices
  • Minimal magic
  • Maximum readability
  • Fast project setup
  • Full developer control

Beacon does not try to hide PHP. Instead, it embraces PHP and provides a solid foundation for building maintainable applications.

License

Beacon is open-sourced software licensed under the MIT License.

Local Docker environment setup

Beacon comes with a pre-configured Docker container setup, consisting of 3 containers: - beacon-webserver (Nginx, PHP 8.5) - beacon-maria (MariaDB 11.5) - beacon-mailpit (Mailpit [latest])

Generate SSL cert & key for local Docker environment

To run the local Docker container setup, you should first generate a fresh SSL cert and key. To do so, follow the steps below.

Generating SSL cert
openssl req -x509 -nodes -days 365 -subj "/C=CA/ST=QC/O=SHWorX/CN=beacon.local" -addext "subjectAltName=DNS:beacon.local" -newkey rsa:2048 -keyout ./docker/config/ssl/beacon.local.key -out ./docker/config/ssl/beacon.local.cert;

> Important notes: > 1. If you have changed the CN value beacon.local to any other local domain you want to use, then you also need to update the value for server_name (line 13), and the value in add_header (line 88) in docker/config/conf.d/default.conf. > You also need to update APP_URL in .env to match your local domain. > 2. If you have changed the file names for the cert and the key, then you also need to update the entries in docker/config/conf.d/self-signed.conf.

Generating Diffie-Hellman params
openssl dhparam -out ./docker/config/ssl/dhparam.pem 4096

You can now start the local Docker environment on CLI via Docker compose.

docker compose up -d

Helper aliases inside beacon-webserver container

The beacon-webserver container comes along with some helper aliases: - clearlogs This alias clears the logs: /var/log/nginx/access.log (docker/logs/access.log), /var/log/nginx/error.log (docker/logs/error.log),

Author

Beacon is created and maintained by

Steffen Haase<br> SHWorX Development

Website: https://shworx.com<br> GitHub: https://github.com/SHWorX


Screenshots (3)  
  • login-page.png
  • main-page.png
  • registration-page.png
  Files folder image Files (163)  
File Role Description
Files folder imageapp (1 file, 17 directories)
Files folder imagebin (1 file)
Files folder imagebootstrap (4 files)
Files folder imageconfig (6 files)
Files folder imagedatabase (1 directory)
Files folder imagedocker (1 file, 2 directories)
Files folder imagepublic (2 files, 1 directory)
Files folder imageresources (2 directories)
Files folder imageroutes (1 file)
Files folder imagetests (2 files)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Plain text file console Class Class source
Accessible without login Plain text file docker-compose.yml Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (163)  /  app  
File Role Description
Files folder imageConsole (3 files, 1 directory)
Files folder imageContainer (3 files)
Files folder imageControllers (3 files, 1 directory)
Files folder imageDatabase (2 files)
Files folder imageDTO (5 files)
Files folder imageEnums (2 files)
Files folder imageExceptions (7 files)
Files folder imageHelpers (1 file)
Files folder imageHttp (3 files)
Files folder imageInterfaces (1 file)
Files folder imageMiddleware (4 files)
Files folder imageModels (3 files, 1 directory)
Files folder imageProviders (11 files)
Files folder imageRouting (2 files)
Files folder imageServices (4 files)
Files folder imageSupport (6 files)
Files folder imageView (2 files)
  Plain text file app.php Class Class source

  Files folder image Files (163)  /  app  /  Console  
File Role Description
Files folder imageCommands (1 directory)
  Plain text file Command.php Class Class source
  Plain text file Kernel.php Class Class source
  Plain text file Signature.php Class Class source

  Files folder image Files (163)  /  app  /  Console  /  Commands  
File Role Description
Files folder imageBeacon (11 files, 1 directory)

  Files folder image Files (163)  /  app  /  Console  /  Commands  /  Beacon  
File Role Description
Files folder imageTraits (1 file)
  Plain text file GenerateAppSecretCommand.php Class Class source
  Plain text file GeneratePasswordHashCommand.php Class Class source
  Plain text file GenerateUuidCommand.php Class Class source
  Plain text file MakeControllerCommand.php Class Class source
  Plain text file MakeDtoCommand.php Class Class source
  Plain text file MakeMiddlewareCommand.php Class Class source
  Plain text file MakeMigrationCommand.php Class Class source
  Plain text file MakeModelCommand.php Class Class source
  Plain text file MakeProviderCommand.php Class Class source
  Plain text file MigrateCommand.php Class Class source
  Plain text file MigrateRollbackCommand.php Class Class source

  Files folder image Files (163)  /  app  /  Console  /  Commands  /  Beacon  /  Traits  
File Role Description
  Plain text file MakeTrait.php Class Class source

  Files folder image Files (163)  /  app  /  Container  
File Role Description
  Plain text file Application.php Class Class source
  Plain text file Container.php Class Class source
  Plain text file Resolver.php Class Class source

  Files folder image Files (163)  /  app  /  Controllers  
File Role Description
Files folder imageAuth (4 files, 1 directory)
  Plain text file Controller.php Class Class source
  Plain text file DashboardController.php Class Class source
  Plain text file HomeController.php Class Class source

  Files folder image Files (163)  /  app  /  Controllers  /  Auth  
File Role Description
Files folder imageTraits (1 file)
  Plain text file ForgottenPasswordController.php Class Class source
  Plain text file LoginController.php Class Class source
  Plain text file LogoutController.php Class Class source
  Plain text file RegisterController.php Class Class source

  Files folder image Files (163)  /  app  /  Controllers  /  Auth  /  Traits  
File Role Description
  Plain text file AuthTrait.php Class Class source

  Files folder image Files (163)  /  app  /  Database  
File Role Description
  Plain text file Migration.php Class Class source
  Plain text file MigrationRepository.php Class Class source

  Files folder image Files (163)  /  app  /  DTO  
File Role Description
  Plain text file ForgottenPasswordDto.php Class Class source
  Plain text file LoginDto.php Class Class source
  Plain text file PasswordResetDto.php Class Class source
  Plain text file RegisterDto.php Class Class source
  Plain text file ResendVerificationDto.php Class Class source

  Files folder image Files (163)  /  app  /  Enums  
File Role Description
  Accessible without login Plain text file AuthToken.php Aux. Configuration script
  Accessible without login Plain text file LoginResult.php Aux. Configuration script

  Files folder image Files (163)  /  app  /  Exceptions  
File Role Description
  Plain text file CsrfException.php Class Class source
  Plain text file ExceptionInterface.php Class Class source
  Plain text file HttpException.php Class Class source
  Plain text file InvalidEnumException.php Class Class source
  Plain text file MailerException.php Class Class source
  Plain text file NotFoundException.php Class Class source
  Plain text file ValidationException.php Class Class source

  Files folder image Files (163)  /  app  /  Helpers  
File Role Description
  Plain text file StringHelper.php Class Class source

  Files folder image Files (163)  /  app  /  Http  
File Role Description
  Plain text file Kernel.php Class Class source
  Plain text file Request.php Class Class source
  Plain text file Response.php Class Class source

  Files folder image Files (163)  /  app  /  Interfaces  
File Role Description
  Plain text file MiddlewareInterface.php Class Class source

  Files folder image Files (163)  /  app  /  Middleware  
File Role Description
  Plain text file AuthMiddleware.php Class Class source
  Plain text file CsrfMiddleware.php Class Class source
  Plain text file GuestMiddleware.php Class Class source
  Plain text file RememberMeMiddleware.php Class Class source

  Files folder image Files (163)  /  app  /  Models  
File Role Description
Files folder imageTraits (1 file)
  Plain text file PasswordResetToken.php Class Class source
  Plain text file RememberToken.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files (163)  /  app  /  Models  /  Traits  
File Role Description
  Plain text file HasUuid.php Class Class source

  Files folder image Files (163)  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file ConsoleServiceProvider.php Class Class source
  Plain text file CsrfServiceProvider.php Class Class source
  Plain text file DatabaseProvider.php Class Class source
  Plain text file LoggingServiceProvider.php Class Class source
  Plain text file MailServiceProvider.php Class Class source
  Plain text file RoutingServiceProvider.php Class Class source
  Plain text file ServiceProvider.php Class Class source
  Plain text file ValidationServiceProvider.php Class Class source
  Plain text file ViewServiceProvider.php Class Class source

  Files folder image Files (163)  /  app  /  Routing  
File Role Description
  Plain text file RouteDispatcher.php Class Class source
  Plain text file Router.php Class Class source

  Files folder image Files (163)  /  app  /  Services  
File Role Description
  Plain text file AuthService.php Class Class source
  Plain text file CsrfService.php Class Class source
  Plain text file MailService.php Class Class source
  Plain text file ValidationService.php Class Class source

  Files folder image Files (163)  /  app  /  Support  
File Role Description
  Plain text file Config.php Class Class source
  Plain text file Cookie.php Class Class source
  Plain text file Env.php Class Class source
  Plain text file Flash.php Class Class source
  Plain text file Redirect.php Class Class source
  Plain text file Session.php Class Class source

  Files folder image Files (163)  /  app  /  View  
File Role Description
  Plain text file AppExtension.php Class Class source
  Plain text file View.php Class Class source

  Files folder image Files (163)  /  bin  
File Role Description
  Accessible without login Plain text file setup.php Aux. Configuration script

  Files folder image Files (163)  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source
  Plain text file helpers.php Class Class source
  Plain text file routes.php Class Class source
  Accessible without login Plain text file session.php Aux. Configuration script

  Files folder image Files (163)  /  config  
File Role Description
  Accessible without login Plain text file app.php Aux. Configuration script
  Plain text file commands.php Class Class source
  Accessible without login Plain text file database.php Aux. Configuration script
  Accessible without login Plain text file mailer.php Aux. Configuration script
  Plain text file providers.php Class Class source
  Accessible without login Plain text file twig.php Aux. Configuration script

  Files folder image Files (163)  /  database  
File Role Description
Files folder imagemigrations (3 files)

  Files folder image Files (163)  /  database  /  migrations  
File Role Description
  Plain text file 2026_06_12_115705_create_users_table.php Class Class source
  Plain text file 2026_06_12_115708_...er_tokens_table.php Class Class source
  Plain text file 2026_06_14_111915_...et_tokens_table.php Class Class source

  Files folder image Files (163)  /  docker  
File Role Description
Files folder imageconfig (5 files, 1 directory)
Files folder imagemariadb (2 files)
  Accessible without login Plain text file Dockerfile Data Auxiliary data

  Files folder image Files (163)  /  docker  /  config  
File Role Description
Files folder imageconf.d (3 files)
  Accessible without login Plain text file aliases.sh Data Auxiliary data
  Accessible without login Plain text file fpm-pool.conf Data Auxiliary data
  Accessible without login Plain text file nginx.conf Data Auxiliary data
  Accessible without login Plain text file php.ini Data Auxiliary data
  Accessible without login Plain text file supervisord.conf Data Auxiliary data

  Files folder image Files (163)  /  docker  /  config  /  conf.d  
File Role Description
  Accessible without login Plain text file default.conf Data Auxiliary data
  Accessible without login Plain text file self-signed.conf Data Auxiliary data
  Accessible without login Plain text file ssl-params.conf Data Auxiliary data

  Files folder image Files (163)  /  docker  /  mariadb  
File Role Description
  Accessible without login Plain text file charset.cnf Data Auxiliary data
  Accessible without login Plain text file Dockerfile Data Auxiliary data

  Files folder image Files (163)  /  public  
File Role Description
Files folder imageassets (4 directories)
  Accessible without login Plain text file index.php Aux. Configuration script
  Accessible without login Plain text file site.webmanifest Data Auxiliary data

  Files folder image Files (163)  /  public  /  assets  
File Role Description
Files folder imagecss (2 files)
Files folder imagefavicons (6 files)
Files folder imageimg (6 files)
Files folder imagejs (2 files)

  Files folder image Files (163)  /  public  /  assets  /  css  
File Role Description
  Accessible without login Plain text file neumorphism.css Data Auxiliary data
  Accessible without login Plain text file styles.css Data Auxiliary data

  Files folder image Files (163)  /  public  /  assets  /  favicons  
File Role Description
  Accessible without login Image file apple-touch-icon.png Icon Icon image
  Accessible without login Image file favicon-96x96.png Icon Icon image
  Accessible without login Image file favicon.ico Data Auxiliary data
  Accessible without login Plain text file favicon.svg Data Auxiliary data
  Accessible without login Image file web-app-manifest-192x192.png Icon Icon image
  Accessible without login Image file web-app-manifest-512x512.png Icon Icon image

  Files folder image Files (163)  /  public  /  assets  /  img  
File Role Description
  Accessible without login Image file logo-448x448.png Icon Icon image
  Accessible without login Image file logo-70x70.png Icon Icon image
  Accessible without login Image file logo-brand-and-slogan-1513x448.png Icon Icon image
  Accessible without login Image file logo-brand-and-slogan-236x70.png Icon Icon image
  Accessible without login Image file logo-brand-and-slogan-400x118.png Icon Icon image
  Accessible without login Image file logo-brand-and-slogan-800x237.png Icon Icon image

  Files folder image Files (163)  /  public  /  assets  /  js  
File Role Description
  Accessible without login Plain text file password-mismatch.js Data Auxiliary data
  Accessible without login Plain text file popover.js Data Auxiliary data

  Files folder image Files (163)  /  resources  
File Role Description
Files folder imagestubs (10 files)
Files folder imageviews (6 directories)

  Files folder image Files (163)  /  resources  /  stubs  
File Role Description
  Plain text file controller.stub Class Class source
  Plain text file dto.stub Class Class source
  Plain text file middleware.stub Class Class source
  Plain text file migration.blank.stub Class Class source
  Plain text file migration.create.stub Class Class source
  Plain text file migration.drop.stub Class Class source
  Plain text file migration.update.stub Class Class source
  Plain text file model.standard.stub Class Class source
  Plain text file model.uuid.stub Class Class source
  Plain text file provider.stub Class Class source

  Files folder image Files (163)  /  resources  /  views  
File Role Description
Files folder imageauth (6 files)
Files folder imagedashboard (1 file)
Files folder imageerrors (4 files)
Files folder imagehome (2 files)
Files folder imagelayouts (1 file)
Files folder imagemail (2 files)

  Files folder image Files (163)  /  resources  /  views  /  auth  
File Role Description
  Accessible without login Plain text file common_notification.twig Data Auxiliary data
  Accessible without login Plain text file forgotten_password.twig Data Auxiliary data
  Accessible without login Plain text file login.twig Data Auxiliary data
  Accessible without login Plain text file register.twig Data Auxiliary data
  Accessible without login Plain text file resend_verification_form.twig Data Auxiliary data
  Accessible without login Plain text file reset_password.twig Data Auxiliary data

  Files folder image Files (163)  /  resources  /  views  /  dashboard  
File Role Description
  Accessible without login Plain text file index.twig Data Auxiliary data

  Files folder image Files (163)  /  resources  /  views  /  errors  
File Role Description
  Accessible without login Plain text file 404.twig Data Auxiliary data
  Accessible without login Plain text file 405.twig Data Auxiliary data
  Accessible without login Plain text file 500.twig Data Auxiliary data
  Accessible without login Plain text file generic.twig Data Auxiliary data

  Files folder image Files (163)  /  resources  /  views  /  home  
File Role Description
  Accessible without login Plain text file about.twig Data Auxiliary data
  Accessible without login Plain text file index.twig Data Auxiliary data

  Files folder image Files (163)  /  resources  /  views  /  layouts  
File Role Description
  Accessible without login Plain text file layout.twig Data Auxiliary data

  Files folder image Files (163)  /  resources  /  views  /  mail  
File Role Description
  Accessible without login Plain text file reset_password.twig Data Auxiliary data
  Accessible without login Plain text file verify_email.twig Data Auxiliary data

  Files folder image Files (163)  /  routes  
File Role Description
  Plain text file web.php Class Class source

  Files folder image Files (163)  /  tests  
File Role Description
  Accessible without login Plain text file testfile.txt Doc. Documentation
  Accessible without login Plain text file tests.php Example Example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 98%
Total:0
This week:0