Download the PHP package liar88828/laravel-schema-attributes without Composer
On this page you can find all versions of the php package liar88828/laravel-schema-attributes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download liar88828/laravel-schema-attributes
More information about liar88828/laravel-schema-attributes
Files in liar88828/laravel-schema-attributes
Package laravel-schema-attributes
Short Description PHP 8 attribute-driven schema compiler for Laravel. One schema class drives migrations, models, factories, controllers, and tests — no duplication.
License MIT
Homepage https://github.com/liar88828/laravel-schema-attributes
Informations about the package laravel-schema-attributes
Laravel Schema Attributes
PHP 8 attribute-driven schema compiler for Laravel. One schema class drives everything — migrations, models, factories, controllers, and tests with no duplication.
Reverse Engineering Existing Migrations
Already have a Laravel project with migrations? Import them as schemas with one command:
Example — given this migration:
Generated OrderSchema.php:
After scanning, review the generated schemas and uncomment/add
#[Fillable],#[Required],#[Hidden],#[Cast]as needed.
Concept
Then run one command to generate everything:
This generates:
- ✅ Migration
- ✅ Eloquent model with
$fillable,$hidden,$casts, relations - ✅ Factory with correct Faker calls
- ✅ PHPUnit test covering migration, model wiring, validation, persistence
- ✅ API controller with validation, Auth injection, soft delete & restore
Installation
Laravel auto-discovers the service provider. No manual registration needed.
Artisan Commands
| Command | Description |
|---|---|
schema:make ArticleSchema |
Create a new schema class |
schema:scan |
Reverse-engineer existing migrations → schema classes |
schema:migrate ArticleSchema |
Generate migration |
schema:model ArticleSchema |
Generate Eloquent model |
schema:relations ArticleSchema |
Generate relation methods |
schema:factory ArticleSchema |
Generate factory |
schema:service ArticleSchema |
Generate Service layer class |
schema:controller ArticleSchema |
Generate API controller |
schema:test ArticleSchema |
Generate PHPUnit test |
schema:refresh ArticleSchema |
Generate all of the above |
Available Attributes
Migration
#[Table] #[Column] #[PrimaryKey] #[ForeignKey] #[ForeignSchema]
#[HasOne] #[HasMany] #[BelongsTo] #[BelongsToMany]
Model
#[EloquentModel] #[Fillable] #[Hidden] #[Cast] #[Appended] #[UsesSchema]
Validation
#[Required] #[Email] #[Min] #[Max] #[In] #[Unique] #[Uuid]
#[Confirmed] #[Regex] #[Numeric]
Auth Model Example
HasSchema Trait
Adding use HasSchema to your model gives you:
Authors & Credits
This package was entirely created by AI.
| Role | AI |
|---|---|
| Code & Architecture | Claude (Anthropic) |
| Helper & Consultation | ChatGPT (OpenAI) |
| Human Supervisor | liar88828 |
💡 This is an experiment in AI-driven open source development. Every line of code, architecture decision, bug fix, and this README was written by AI assistants guided by a human developer.
- PHP 8.2+
- Laravel 11 or 12
- spatie/laravel-route-attributes — installed automatically
spatie/laravel-route-attributes is a lightweight package (~50KB) that only depends on illuminate/routing which Laravel already includes. If your project already has any Spatie package installed, there is zero additional cost.
License
MIT — see LICENSE.
All versions of laravel-schema-attributes with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/console Version ^11.0|^12.0
illuminate/filesystem Version ^11.0|^12.0
spatie/laravel-route-attributes Version ^1.0