Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tonysm/eloquent-sti
A lite-weight implementation of SingleTableInheritance (STI) on Eloquent.
https://github.com/tonysm/eloquent-sti
Last synced: about 1 month ago
JSON representation
A lite-weight implementation of SingleTableInheritance (STI) on Eloquent.
- Host: GitHub
- URL: https://github.com/tonysm/eloquent-sti
- Owner: tonysm
- Created: 2015-12-30T20:23:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-31T00:47:17.000Z (almost 9 years ago)
- Last Synced: 2024-05-01T20:22:07.240Z (7 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A lite-weight implementation of SingleTableInheritance (STI) on Eloquent.
## Introduction
Let's say you have a User model like so:
```php
create();
factory(User::class)->create(['type' => Employee::class]);
$users = User::all();
```This would result in a collection containing one instance of `User` and one instance of `Employee`.
Check the [tests](tests/) folder for more usage examples.