https://github.com/websemantics/pyro-entity
An Entity is a representation of an Object Type which may correspond with a Stream,.. for example, a Person, a Company or an Animal can all be generated as Pyro Entities
https://github.com/websemantics/pyro-entity
Last synced: 7 months ago
JSON representation
An Entity is a representation of an Object Type which may correspond with a Stream,.. for example, a Person, a Company or an Animal can all be generated as Pyro Entities
- Host: GitHub
- URL: https://github.com/websemantics/pyro-entity
- Owner: websemantics
- Created: 2015-03-19T19:47:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-30T03:39:31.000Z (over 10 years ago)
- Last Synced: 2025-02-17T11:12:05.643Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 203 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#PyroEntity
An Entity is a representation of an Object Type which may correspond with a Stream,.. for example, a Person, a Company or an Animal can all be generated as Pyro Entities
#{{entity_name}} Entity
{{description}}
#Install
(1) Move the Http folder to your module's corresponding Http folder.
(2) Add the following lines to your Module's ServiceProvider: {{module_name}}ModuleServiceProvider.
/**
* The class bindings.
*
* @var array
*/
protected $bindings = [
'{{vendor_name}}\\{{module_name}}Module\\{{entity_name}}\\{{entity_name}}Model' => '{{vendor_name}}\\{{module_name}}Module\\{{entity_name}}\\{{entity_name}}Model'
];
/**
* The singleton bindings.
*
* @var array
*/
protected $singletons = [
'{{vendor_name}}\\{{module_name}}Module\\{{entity_name}}\Contract\\{{entity_name}}RepositoryInterface' => '{{vendor_name}}\\{{module_name}}Module\\{{entity_name}}\\{{entity_name}}Repository',
];
/**
* The addon routes.
*
* @var array
*/
protected $routes = [
'admin/{{toLowerCase module_name}}/{{toLowerPlural entity_name}}' => '{{vendor_name}}\\{{module_name}}Module\Http\Controller\Admin\\{{toPlural entity_name}}Controller@index',
'admin/{{toLowerCase module_name}}/{{toLowerPlural entity_name}}/create' => '{{vendor_name}}\\{{module_name}}Module\Http\Controller\Admin\\{{toPlural entity_name}}Controller@create',
'admin/{{toLowerCase module_name}}/{{toLowerPlural entity_name}}/edit/{id}' => '{{vendor_name}}\\{{module_name}}Module\Http\Controller\Admin\\{{toPlural entity_name}}Controller@edit',
];
(3) Add the following code to the Module's sections in {{module_name}}Module.php
/**
* The module sections.
*
* @var array
*/
protected $sections = [
'{{toLowerPlural entity_name}}' => [
'buttons' => [
'create'
]
]
];
(4) Update your language file, at for example, 'resources/lang/en/addon.php'
return [
'section' => [
'{{toLowerPlural entity_name}}' => '{{toPlural entity_name}}'
]
];
(5) Finally, you can relocate the Plugin and the Seeder classes anywhere in your application.
{{generatedBy}}