PHPackages                             packettide/sire - 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. packettide/sire

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

packettide/sire
===============

Better Laravel 4 Generators

7142PHP

Since Feb 4Pushed 12y ago3 watchersCompare

[ Source](https://github.com/packettide/Sire)[ Packagist](https://packagist.org/packages/packettide/sire)[ RSS](/packages/packettide-sire/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Sire
====

[](#sire)

Awesome YAML generation for Laravel
-----------------------------------

[](#awesome-yaml-generation-for-laravel)

Sire allows you to generate models, views, controller, and migrations based on a YAML description file. This makes for repeatedable, tweakable generation. It generates views that utilize Bootstrap 3.

### Features

[](#features)

- Generate Bree-enhanced models
- Your models can have relationships and validation rules
- Your views will have nice real names, no more `Add new long_named_thing` buttons
- Auto generates excelent forms for creation and editing of models
- Show real names for fields (rather than variable names) and shows properties across relations

Getting Started
---------------

[](#getting-started)

1. Add `"packettide/sire": "@dev"` to the require block of your `composer.json`
2. Do a `composer update`
3. Add `'Packettide\Sire\SireServiceProvider',` to the end of your app config providers array
4. Setup a simple YAML file representing your model:

    ```
     _name: thing
     _makes:
     	- model
     	- view
     	- controller
     	- migration
     	- route
     _viewTheme: bs3
     _codeTheme: default

     title:
     	sqlType: string
     	fieldType: Text
     	label: Title
     	validation:
     		- required

    ```

The `_name` field tells Sire what the name of the things (views, controller, model, table and routes) you are generating is

- It should be a singular, snake case, name. Sire will turn that into the other formats of the name it needs, including real words.

The `_makes` field tells Sire what to generate for this model. Current options are

- `model`
- `view`
- `controller`
- `migration`
- `route`
- `seed`
- Pivots and more coming soon.

The `_viewTheme` field tells Sire what the visual look of the app should be. For right now the only options are:

- `bs3`, which is a Bootstrap 3 powered look
- `naked` which just generates bare information that you should wrap your own markup around.
- `foundation5`, based on the new version of Zurb Foundation. (Note: This is on the experimental side and may be a little broken in places.)

The `_codeTheme` doesn't do anything for now but it is there for fowards compatibility

In addition to these special paramters there are also the members of the model. The `title` field is a parameter that will appear on the resulting model.

- It has an `sqlType` which tells the migration generator what format the column should be, see [here](http://laravel.com/docs/schema) for more info about the types availible.
- The `fieldType` field describes how the generated forms will interact with the parameter.
- The `label` is simply the label.
- The `validation` field is a list of the rules that the parameter should obey. That small amount of YAML is enough to get you started with Sire.

Advanced Usage
--------------

[](#advanced-usage)

#### Field Options

[](#field-options)

```
image:
	label: An Image
	sqlType: string
	fieldType: File
	fieldTypeOptions:
		directory: "/uploads/images"

```

Here we have a file field. File fields in Bree need to know what directory you want the upload to go to. In Sire we specify that as a `fieldTypeOptions`. We set a `fieldTypeOption` named `directory` and give it a value of `"/uploads/images"`. The same works for other options as well.

#### Adding a hasMany

[](#adding-a-hasmany)

```
other:
  label: Other Thing
  fieldType: Cell
  relationshipType: hasMany
  relatedModel: Other

```

We give this field a fieldType of Cell, since it will represent a hasMany by giving you the option to create new instances of the Other model and attaching them to this model. We have to give it:

- `relationshipType` which tells Sire that this is a hasMany relationship
- `relatedModel` with tells Sire what class is going to be related on this relationship

#### Adding a belongsTo

[](#adding-a-belongsto)

```
more:
	label: More Things
	fieldType: Relate
	fieldTypeOptions:
		select: true
		title: title
	relationshipType: belongsTo
	relatedModel: More

```

We are going to give this field a fieldType of Relate. A belongsTo will mean that the migration for this model will have a `more_id` with the type integer. We this field:

- `relationshipType` which tells Sire that it is a belongsTo
- `relatedModel` which tells Sire to relate it to the more class
- `fieldTypeOptions` telling Sire that we want this to be select relate rather than a radio button and we want to label each option with the title from that model.

#### Adding a Seeder

[](#adding-a-seeder)

The `_seeds` special field is used to create a seeder.

```
_seeds:
	-
		title: ' "Thing One" '
		new: ' false '
	-
		title: ' "Thing Two" '
		new: ' true '

```

This will create two intances of our `Thing` model with different titles. The most important thing to not here is that we cannot use bare strings. In order for Sire to understand your seeds you need wrap them in `'`, additionally you will want to wrap the words Thing One and Thing Two in `"` since these are strings. This is slightly confusing but required due to the way yaml works. You can see that with the boolean field new, we do not wrap it in `"`, since it is not a string.

Lastly we need to tell Sire to make a seed, like so:

```
_makes:
	- model
	- view
	- controller
	- migration
	- route
	- seed

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.7% 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://avatars.githubusercontent.com/u/563996?v=4)[Bryan Nielsen](/maintainers/bryannielsen)[@bryannielsen](https://github.com/bryannielsen)

![](https://avatars.githubusercontent.com/u/3113549?v=4)[Max Walker](/maintainers/SegFaultx64)[@SegFaultx64](https://github.com/SegFaultx64)

---

Top Contributors

[![maxwalker](https://avatars.githubusercontent.com/u/4551454?v=4)](https://github.com/maxwalker "maxwalker (57 commits)")[![bryannielsen](https://avatars.githubusercontent.com/u/563996?v=4)](https://github.com/bryannielsen "bryannielsen (3 commits)")[![SegFaultx64](https://avatars.githubusercontent.com/u/3113549?v=4)](https://github.com/SegFaultx64 "SegFaultx64 (3 commits)")[![TomJaeger](https://avatars.githubusercontent.com/u/422821?v=4)](https://github.com/TomJaeger "TomJaeger (2 commits)")

### Embed Badge

![Health badge](/badges/packettide-sire/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k129.4M835](/packages/barryvdh-laravel-ide-helper)[patrickschur/stanford-nlp-tagger

PHP wrapper for the Stanford Natural Language Processing library. Supports POSTagger and CRFClassifier.

7429.2k1](/packages/patrickschur-stanford-nlp-tagger)[molbal/ai-phpdoc

Writes missing PHPDoc comments using GPT-3.

194.4k](/packages/molbal-ai-phpdoc)

PHPackages © 2026

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