PHPackages                             dwoodard/schemagen - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dwoodard/schemagen

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dwoodard/schemagen
==================

A package to parse custom schema syntax and generate Laravel and Vue files.

04PHP

Since Nov 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dwoodard/SchemaGen)[ Packagist](https://packagist.org/packages/dwoodard/schemagen)[ RSS](/packages/dwoodard-schemagen/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SchemaGen
=========

[](#schemagen)

SchemaGen is a package designed to parse a custom schema syntax and generate Laravel models, migrations, controllers, and Vue components. This tool allows you to centralize model and component definitions in a single file and automate code generation.

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

[](#installation)

Install via Composer:

```
composer require dwoodard/schemagen
```

```
Summary of Symbols for Extended Laravel Features
@           - Model declaration
-           - Standard properties (Fillable in Model, Used in Seeder and Factory
-&          - placeholders for AI-generated content (ai_ suffix in DB, nullable to start)
=           - Computed properties
>           - Relationships (use with(...) for filtered relationships)
?           - Scopes - used to define query scopes
~           - Accessors and Mutators (getters and setters)
%           - Casts (casts property to specified type)
!           - Validations (required, max, min, etc.)
@Job        - Specifies background tasks to be run asynchronously
@Event      - Defines events that trigger real-time updates or actions
@Listener   - Defines listeners that respond to events
@Component  - Creates Vue components with properties and methods
@Event - Defines events that can trigger actions or real-time updates

```

Usage create the schema file call schema.lsd (Laravel Schema Definitions) with the following command:

```
# If no schema file is specified, `schema.lsd` will be used as the default.
php artisan generate:schema [database/schemas/schema.lsd]
```

Example Schema
--------------

[](#example-schema)

```
@ Dog

- id: integer, primary_key
- name: string, required
- birthday: date
- breed: string
- gender: enum(m,f), required

= age: integer -> calculate based on birthday
= is_puppy: boolean -> check if age < 1

> toys: hasMany(Toy)
> owner: belongsTo(User)
> active_toys: hasMany(Toy) with(status = active)

? puppies -> where age < 1
? adults -> where age >= 1

~ full_name: string -> concatenate first_name and last_name
~ birth_year: integer -> extract year from birthday

% age: integer
% birthday: datetime

! name:
    required -> name is required
    max:255 -> name must be less than 255 characters
    unique -> name must be unique
! gender: in(m,f)
! birthday: required, date
! breed: max:50
! age: integer

$ creating: checkUniqueName
$ deleting: logDeletion

^ view: checkViewPermission
^ update: checkUpdatePermission

@Job DogCleanup -> clean up old dog records
@Event DogCreated -> emit when dog is created
@Listener DogCreatedListener -> listen for DogCreated event

@Component DogProfile

---

@Component DogProfile

- name: string, required
- breed: string
= formattedAge -> format age as "2 years, 3 months"
= isPuppyStatus -> return "Puppy" if age < 1, else "Adult"

$ showDetails: boolean -> initial value: false

~ toggleDetails -> toggles showDetails
~ fetchDogInfo -> fetches additional dog data from API

! dogSelected: emits event when dog is selected

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ee24e478cce0c4762197a3c1d07c026221216c1ef0acd682ff63deaa2e388b3?d=identicon)[dwoodard](/maintainers/dwoodard)

---

Top Contributors

[![dwoodard](https://avatars.githubusercontent.com/u/77433?v=4)](https://github.com/dwoodard "dwoodard (17 commits)")

### Embed Badge

![Health badge](/badges/dwoodard-schemagen/health.svg)

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

###  Alternatives

[faonni/module-price

Rounding Price to Prettier Value for Multi-Currency Stores.

63120.9k](/packages/faonni-module-price)[php-tuf/php-tuf

PHP implementation of The Update Framework (TUF)

456.5k1](/packages/php-tuf-php-tuf)[shdev/phpflashtext

A port of the flashtext python implementation

2030.7k](/packages/shdev-phpflashtext)[magefan/module-catalog

Fixes for magento issues in catalog

2314.0k](/packages/magefan-module-catalog)[webinarium/php-dictionary

Static dictionary implementation for PHP

1019.1k](/packages/webinarium-php-dictionary)

PHPackages © 2026

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