bug fixes

This commit is contained in:
Amine Ben hammou 2015-09-23 05:38:56 +01:00
parent 04ce3077cd
commit 4a60029604
5 changed files with 32 additions and 6 deletions

View File

@ -1,7 +1,8 @@
{ {
"type": "array", "type": "array",
"format": { "fields": {
"type": "object", "type": "object",
"separator": ":",
"fields": [ "fields": [
"name", "name",
{ {

21
lumen-test/app/Test.php Normal file
View File

@ -0,0 +1,21 @@
<?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Test extends Model {
protected $fillable = [];
protected $dates = [];
public function users()
{
return $this->hasMany('App\User');
}
public function number()
{
return $this->hasMany('Phone');
}
}

View File

@ -3699,12 +3699,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webNeat/lumen-generators.git", "url": "https://github.com/webNeat/lumen-generators.git",
"reference": "558ebd5f0a9e2c7e9043d9bff5073873057c5df9" "reference": "04ce3077cd2723b38424e1ea94844582b67c6b79"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webNeat/lumen-generators/zipball/558ebd5f0a9e2c7e9043d9bff5073873057c5df9", "url": "https://api.github.com/repos/webNeat/lumen-generators/zipball/04ce3077cd2723b38424e1ea94844582b67c6b79",
"reference": "558ebd5f0a9e2c7e9043d9bff5073873057c5df9", "reference": "04ce3077cd2723b38424e1ea94844582b67c6b79",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3736,7 +3736,7 @@
"lumen", "lumen",
"rest" "rest"
], ],
"time": "2015-09-23 02:22:02" "time": "2015-09-23 03:58:39"
} }
], ],
"aliases": [], "aliases": [],

View File

@ -6,6 +6,8 @@ class TestingModel extends Model {
protected $fillable = []; protected $fillable = [];
protected $dates = ["started_at"]; protected $dates = [];
} }

View File

@ -73,6 +73,8 @@ class ModelCommand extends BaseCommand {
$item['type'] = $type; $item['type'] = $type;
if(! $item['model']){ if(! $item['model']){
$item['model'] = $this->getNamespace() . '\\' . ucwords(str_singular($item['name'])); $item['model'] = $this->getNamespace() . '\\' . ucwords(str_singular($item['name']));
} else if(strpos($item['model'], '\\') === false ){
$item['model'] = $this->getNamespace() . '\\' . $item['model'];
} }
$relations[] = $template->with($item)->get(); $relations[] = $template->with($item)->get();
} }