Download the PHP package roy404/framework without Composer

On this page you can find all versions of the php package roy404/framework. 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 framework

PHP Framework Documentation

Welcome to the official documentation for the PHP Framework — a modern, lightweight, and developer-friendly web application framework designed for speed, simplicity, and scalability.

This guide will walk you through installation, configuration, and usage of the framework, along with its key components and features.

Core Services & Technologies

This project uses a modern containerized architecture powered by Docker, combining application code, databases, caching, queues, and local AWS emulation.

Languages & Frameworks

PHP Blade SCSS TailwindCSS Xdebug Socket.IO Docker

Infrastructure & Services

This setup provides a full-featured development environment that mirrors production as closely as possible, while staying lightweight and developer-friendly.


Table of Contents


Getting Started

Installation

Install the framework using Composer:

Once installed, navigate to your project root directory and start the local development server:


⚙️ Configuration

1. Server Requirements

Make sure your system meets the following minimum requirements:

If PHP or Composer are not installed yet, follow these steps:

Install PHP (Mac / Linux)

or on macOS:

Install Composer

Verify installation:

Windows

  1. Download PHP from: https://windows.php.net/download/
  2. Add the PHP folder to your system PATH.
  3. Download Composer from: https://getcomposer.org/download/
  4. Run the installer and follow the prompts.

After installation, open Command Prompt or PowerShell and verify:

If these commands return version numbers, both are installed correctly.

Additionally, If you want to use Docker just install it here: https://www.docker.com/products/docker-desktop


2. Environment File (.env)

Before running the project, configure your environment settings.

  1. Copy the example file if needed:
    cp .env.example .env

  2. Update the values as needed — especially:
    • APP_URL (e.g. http://localhost:8000)
    • Database credentials
    • Mail settings
    • AWS or LocalStack credentials (if applicable)
    • PROJECT_ID — make sure this value is unique for each project to avoid Docker container name conflicts.
      Example:
      • Project 1 → PROJECT_ID=myproject1
      • Project 2 → PROJECT_ID=myproject2

3. Docker Setup

Start the development environment using Docker:

Once all containers are running, you can access the following services:

Service URL Description
🧱 App (PHP) http://localhost:8000 Main application
🐘 phpMyAdmin http://localhost:8080 MySQL database manager
💌 MailHog UI http://localhost:8025 View test emails sent from the app
🧠 Redis localhost:6379 In-memory cache database
🧰 Memcached localhost:11211 Caching service
☁️ LocalStack http://localhost:4566 Local AWS cloud service emulator

Tip: You can check logs for any service using
docker-compose logs -f

Example:


Stop and Clean Up

To stop and remove all running containers:

If you also want to remove associated volumes and networks (fresh start):


Troubleshooting (quick)


🧰 Common Commands


Tip for multiple projects:
If you run multiple Docker projects at once, always give each one a unique PROJECT_ID and different port numbers to avoid conflicts.
Example:


Available Services

Your development environment comes preconfigured with the following services:


🏗 Framework Overview

The framework provides a modular architecture with the following core components.

1. Routing

Routes are the entry points of your application. They define how incoming HTTP requests (such as GET, POST, PUT, or DELETE) are mapped to specific actions in your code — usually a function or a controller method.

Think of them as a map:

Define routes in the routes/web.php file:

Available Routing Methods:

The framework provides a fluent, expressive API for defining routes.
Below are the available static methods for configuring routes:

Method Description
put(string \$uri, string|array|Closure \$action = []) Defines a PUT route.
patch(string \$uri, string|array|Closure \$action = []) Defines a PATCH route.
delete(string \$uri, string|array|Closure \$action = []) Defines a DELETE route.
get(string \$uri, string|array|Closure \$action = []) Defines a GET route.
post(string \$uri, string|array|Closure \$action = []) Defines a POST route.
group(array \$attributes, Closure \$action) Registers a group of routes with shared configurations and middleware, enhancing route organization and reusability.
controller(string \$className) Registers a controller to handle the route actions.
middleware(string|array \$action) Assigns middleware to the route for request filtering.
prefix(string \$prefix) Adds a URI prefix to all routes in the group.
name(string \$name) Assigns a name to the route, useful for generating URLs.
domain(string|array \$domain) Binds the route to a specific domain or subdomain.
where(string \$key, string \$expression) Defines a regular expression constraint for a route parameter.

2. Cron Scheduler

The Scheduler provides a route-like API for defining and managing recurring tasks using cron expressions.

Instead of handling raw cron jobs directly, you define schedules in a clean and expressive way — similar to defining routes.

All schedules are defined in the routes/cron.php file:

Sample Schedules

Available Frequency Methods

The scheduler provides expressive helpers for defining task frequency:

Method Description
everyMinute() Run the task every minute.
everyFiveMinutes() Run the task every 5 minutes.
hourly() Run the task every hour.
daily() Run the task daily at midnight.
weekly() Run the task weekly on Sunday at midnight.
monthly() Run the task monthly on the 1st at midnight.
yearly() Run the task yearly on January 1st at midnight.
cron($expression) Use a custom cron expression (e.g., 0 6 * * 1-5).
at('HH:MM') Run the task daily at a specific time.

3. Middleware

Middlewares are responsible for filtering and processing HTTP requests before they reach your controllers or route logic. They can be used for authentication, authorization, input validation, logging, or modifying responses.

You can define your middleware in the Handler/Middleware directory:

Example Usage
To register your middleware, open app/Routes.php and attach it to a route group:

This ensures that every request under the web group passes through the Account middleware before rendering the final page.

4. Controllers

Controllers are responsible for handling request/response logic. They act as an intermediary between your routes and your business logic, keeping your code organized and maintainable.

You can define controllers in the Handler/Controllers directory:

Example Usage:


5. Model

Models represent your database tables and provide an abstraction layer for querying and manipulating records.
Each model maps to a database table and defines the structure of its data.

Example Model:


Querying with Models

Models provide a simple, expressive interface for database operations.

Insert a new record:

Fetch active users:

`

Check if a record exists:

Fetch a single column (by primary key):


Using the Database Facade Directly

For advanced queries, you can use the Database facade directly.

Insert a record:

Run a raw query:

Count total records:

Query from a specific connection:


6. Schema Builder

The Schema Builder provides a programmatic way to create, modify, and manage database tables.

It works with closures to define table blueprints and runs SQL queries under the hood.


Creating Tables

`


Modifying Tables


Renaming and Dropping Tables


Columns Management


Indexes and Keys


Table Options


Export Table Definition

✅ With Schema, you can define migrations, manage schema changes, and keep your database structure consistent across environments.


7. Views & Blade Templates

The framework uses the Blade templating engine, which provides a clean and expressive syntax for building your views. Blade templates are compiled into plain PHP and cached for optimal performance.

Common Blade Directives

Directives Description Example
{{ $var }} Escaped output {{ $user->name }}
{!! $html !!} Unescaped output (renders HTML) {!! $post->content !!}
@if / @elseif / @else / @endif Conditional logic @if($user) ... @endif
@foreach / @endforeach Loop through an array or collection @foreach($items as $item) ... @endforeach
@for / @endfor Basic for loop @for($i = 0; $i < 5; $i++) ... @endfor
@include('layout') Include the path content @include('header')
@csrf Insert a CSRF token for forms <form>@csrf</form>
@php / @endphp PHP Tags @php $test = "foo"; @endphp
@post Grab the POST Global Variable @post('email')

8. Artisan CLI

The framework includes a powerful command-line interface called Artisan, designed to help you perform common development tasks quickly — such as running servers, managing migrations, creating files, and clearing caches.

You can run Artisan commands using:

Common Commands


9. StreamWire

Build reactive, stateful UI components with StreamWire — without writing any JavaScript.

StreamWire integrates seamlessly with Blade templates, allowing you to render dynamic components directly in your views.

Example content ./views/components/counter.blade.php:

You can embed reactive components directly inside your Blade views.
Simply call the stream() helper function and pass the component class.

Example:

This will render the Counter component and make it fully interactive without writing any JavaScript.

Common Stream-Wire Element Attributes Action

Directives Description Example
wire:model Two-way data binding between input fields and component properties <input type="text" wire:model="name">
wire:click Trigger an action method on click <button wire:click="save()">Save</button>
wire:submit Listen for form submission and call a method <form wire:submit="register()">...</form>
wire:keydown.keypress Trigger a method on a specific keypress event <input wire:keydown.keypress="search(event.target.value)">
wire:keydown.enter Trigger an action method when Enter is pressed <input wire:keydown.enter="submitForm()">
wire:keydown.escape Run a method when Escape is pressed <input wire:keydown.escape="resetForm()">
wire:loader Show or hide elements or more while a request is processing <div wire:loader.classList.add="active">Loading...</div>

🔧 Advanced Topics

1. Real-Time Communication (Socket.IO)

To support real-time updates such as live notifications, chat, or dashboard syncing, this project includes a dedicated Socket.IO microservice built with Node.js and integrated into the Docker environment.


Core Features


Technologies

Node.js Socket.IO Express Docker


Docker Service Definition

To scaffold a ready-made Socket.IO service within your project, run:

This command generates a preconfigured Node.js Socket.IO setup inside your project directory (/node by default).


Next, register the Socket service in your docker-compose.yml file:

Once added, rebuild and start your containers:

This will build and launch the Socket.IO container, making it accessible at 👉 http://localhost:3000


Quick Frontend Test

You can verify the socket connection by embedding the following script in your Blade or HTML view:

When you reload the page, open your browser console — you should see messages confirming a successful connection between the frontend and the Socket.IO server.


2. Cron Jobs & Scheduler

The project includes a built-in task scheduler for handling automated and recurring jobs (e.g., queue processing, cleanups, reports).

In a Docker environment, the scheduler container runs automatically — no additional configuration is required.

However, in a production environment, you’ll need to register the scheduler manually in your system crontab to ensure it runs every minute:

Explanation


3. LocalStack & AWS Integration

Use LocalStack to emulate AWS services locally during development. This allows you to test S3 storage and other AWS features without connecting to a real AWS account.

Create a new bucket:

List existing buckets:

💡 Note: LocalStack is intended only for local development and testing. On a production server, you must configure real AWS credentials and services (e.g., using IAM roles, S3 buckets, etc.).


🤝 Contributing

Contributions are welcome! Please fork the repository and submit a pull request.


📜 License

This framework is open-source software licensed under the MIT license.


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
roy404/utilities Version ^8.4.1
roy404/routes Version ^4.3
roy404/blades Version ^1.4
aws/aws-sdk-php Version ^3.0
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 roy404/framework contains the following files

Loading the files please wait ...