mirror of
https://github.com/ZorgCC/lumen-generators.git
synced 2025-01-13 13:57:55 +03:00
updating wn:resources to follow changes on wn:resource
This commit is contained in:
parent
482cc3f8c4
commit
cfe5b2f69b
@ -5,7 +5,7 @@ APP_KEY=SomeRandomKey!!!
|
||||
# APP_LOCALE=en
|
||||
# APP_FALLBACK_LOCALE=en
|
||||
|
||||
# DB_CONNECTION=mysql
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=localhost
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=homestead
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
Post:
|
||||
belongsToMany: tags
|
||||
add: timestamps softDeletes
|
||||
fields:
|
||||
title:
|
||||
schema: string
|
||||
|
0
lumen-test/storage/database.sqlite
Normal file
0
lumen-test/storage/database.sqlite
Normal file
@ -26,6 +26,7 @@ class ResourcesCommand extends BaseCommand {
|
||||
$this->call('wn:resource', [
|
||||
'name' => $i['name'],
|
||||
'fields' => $i['fields'],
|
||||
'--add' => $i['add'],
|
||||
'--has-many' => $i['hasMany'],
|
||||
'--has-one' => $i['hasOne'],
|
||||
'--belongs-to' => $i['belongsTo'],
|
||||
@ -35,7 +36,7 @@ class ResourcesCommand extends BaseCommand {
|
||||
]);
|
||||
}
|
||||
|
||||
// $this->call('migrate');
|
||||
$this->call('migrate');
|
||||
|
||||
$this->pivotTables = array_map(
|
||||
'unserialize',
|
||||
@ -56,14 +57,14 @@ class ResourcesCommand extends BaseCommand {
|
||||
// ]);
|
||||
}
|
||||
|
||||
// $this->call('migrate');
|
||||
$this->call('migrate');
|
||||
}
|
||||
|
||||
protected function getResourceParams($modelName, $i)
|
||||
{
|
||||
$i['name'] = snake_case($modelName);
|
||||
|
||||
foreach(['hasMany', 'hasOne', 'belongsTo', 'belongsToMany'] as $relation){
|
||||
foreach(['hasMany', 'hasOne', 'add', 'belongsTo', 'belongsToMany'] as $relation){
|
||||
if(isset($i[$relation])){
|
||||
$i[$relation] = $this->convertArray($i[$relation], ' ', ',');
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user