PHPackages                             larafony/skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. larafony/skeleton

ActiveProject[Framework](/categories/framework)

larafony/skeleton
=================

Larafony Framework Application Skeleton

2.0.1(5mo ago)1232MITBladePHP &gt;=8.5

Since Oct 26Pushed 5mo agoCompare

[ Source](https://github.com/DJWeb-Damian-Jozwiak/larafony-demo-app)[ Packagist](https://packagist.org/packages/larafony/skeleton)[ RSS](/packages/larafony-skeleton/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (6)Used By (0)

Larafony Skeleton - Demo Application
====================================

[](#larafony-skeleton---demo-application)

Full-featured demo application for the **Larafony Framework** showcasing real-world usage patterns and best practices.

What's Included
---------------

[](#whats-included)

This application demonstrates:

### 🗄️ **Database &amp; ORM**

[](#️-database--orm)

- **Active Record ORM** with relationship management
- **belongsTo** - Note → User relationship
- **hasMany** - User → Comments, Note → Comments
- **belongsToMany** - Note ↔ Tags (pivot table)
- **Query Builder** with fluent API
- **Migrations** using Schema Builder
- **Seeders** for demo data

### 🎨 **Views &amp; Templates**

[](#-views--templates)

- **Blade Template Engine** with custom directives
- **Components** (Layout, Alert, InfoCard, StatusBadge)
- **Slots** for component composition
- **@if, @foreach, @component** directives
- Nested components with proper compilation

### 🔄 **Data Handling**

[](#-data-handling)

- **Form Requests (DTOs)** with automatic validation
- **Type-safe data transfer** using PHP 8.5 property hooks
- **Union type support** (string|array|null)
- **Automatic hydration** from HTTP requests

### 🛣️ **Routing &amp; Controllers**

[](#️-routing--controllers)

- **Attribute-based routing** - `#[Route('/path', 'METHOD')]`
- **Controller base class** with helpers (view, json, redirect)
- **Automatic DTO injection** via FormRequestAwareHandler
- **RESTful API endpoints** with JSON responses

### 💻 **Console Commands**

[](#-console-commands)

- **Interactive setup command** - `build:notes`
- **Database connection testing**
- **Automatic migration runner**
- **Data seeding**

### ⚙️ **PHP 8.5 Features**

[](#️-php-85-features)

- **Property hooks** for computed properties
- **Asymmetric visibility** - `public protected(set)`
- **Attributes** for routing and relationships
- **Union types** and null-safe operators

Installation
------------

[](#installation)

```
composer create-project larafony/skeleton my-app
cd my-app
```

Setup
-----

[](#setup)

Run the interactive installation command:

```
php8.5 bin/larafony build:notes
```

The installer will:

- Check your database connection
- Prompt for database credentials if needed (interactive setup)
- Create the database if it doesn't exist
- Run all migrations
- Seed demo data (user, tags, notes)

**Note**: The command will automatically configure your `.env` file based on your input.

Development Server
------------------

[](#development-server)

Start the built-in PHP server:

```
php -S localhost:8000 -t public
```

Visit:

Features Showcase
-----------------

[](#features-showcase)

### 📝 **Web Interface** - `/notes`

[](#-web-interface---notes)

The notes application demonstrates a complete CRUD workflow:

**List Notes**

- Displays all notes with user, tags, and comment count
- Shows relationship loading (N+1 prevention)
- Blade components for consistent UI

**Create Note**

- HTML form with validation
- Tag creation and attachment (many-to-many)
- DTO-based request handling
- Automatic tag parsing (comma-separated)

**View Note Details**

- Author information (belongsTo)
- All tags (belongsToMany)
- All comments (hasMany)

### 🔌 **API Endpoints**

[](#-api-endpoints)

**`GET /api/notes`** - List all notes with relations

```
{
  "notes": [
    {
      "id": 1,
      "title": "Welcome to Larafony",
      "content": "...",
      "user": { "id": 1, "name": "Admin" },
      "tags": [ { "id": 1, "name": "framework" } ],
      "comments": [ { "id": 1, "content": "Great!" } ]
    }
  ]
}
```

**`POST /api/notes`** - Create new note

```
{
  "title": "My Note",
  "content": "Note content",
  "tags": ["php", "framework"]
}
```

**`POST /api/comments`** - Add comment

```
{
  "note_id": 1,
  "content": "This is a comment"
}
```

### 💡 **Code Examples**

[](#-code-examples)

**ORM Relationships with Attributes**

```
class Note extends Model
{
    #[BelongsTo(related: User::class, foreign_key: 'user_id')]
    public ?User $user {
        get => $this->relations->getRelation('user');
    }

    #[BelongsToMany(
        related: Tag::class,
        pivot_table: 'note_tag',
        foreign_pivot_key: 'note_id',
        related_pivot_key: 'tag_id'
    )]
    public array $tags {
        get => $this->relations->getRelation('tags');
    }
}
```

**DTO with Property Hooks**

```
class CreateNoteDto
{
    #[IsValidated]
    public protected(set) string|array|null $tags {
        get {
            if (!isset($this->tags)) return null;
            if (is_array($this->tags)) return $this->tags;
            return array_map('trim', explode(',', $this->tags));
        }
        set => $this->tags = $value;
    }
}
```

**Controller with Automatic DTO Injection**

```
#[Route('/notes', 'POST')]
public function store(CreateNoteDto $dto): ResponseInterface
{
    // $dto is automatically created and validated from request
    $note = new Note()->fill([
        'title' => $dto->title,
        'content' => $dto->content,
    ]);
    $note->save();

    if ($dto->tags) {
        $note->attachTags($tagIds);
    }

    return $this->redirect('/notes');
}
```

Requirements
------------

[](#requirements)

- PHP 8.5 or higher
- MySQL/PostgreSQL/SQLite
- Composer

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance70

Regular maintenance activity

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

5

Last Release

177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41979fa3adf74e308157185e30a99c93795d8bb8c33f35dbcef030cb3c9865c2?d=identicon)[damek24](/maintainers/damek24)

---

Top Contributors

[![damek24](https://avatars.githubusercontent.com/u/11960180?v=4)](https://github.com/damek24 "damek24 (19 commits)")

### Embed Badge

![Health badge](/badges/larafony-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/larafony-skeleton/health.svg)](https://phpackages.com/packages/larafony-skeleton)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
