Closed phillipmadsen closed 8 years ago
non development version
Actually it is creating the model output inside of another model output
Full Model Output:
<?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;
<?php
namespace App\Models;
use Eloquent as Model;
$SOFT_DELETE_IMPORT$
$DOCS$
class Location extends Model
{
$SOFT_DELETE$
public $table = 'locations';
$SOFT_DELETE_DATES$
public $fillable = [
'location_type',
'nickname',
'address',
'street',
'street_additional',
'city',
'state',
'country',
'zipcode',
'latitude',
'longitude',
'filter_class'
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'location_type' => 'string',
'nickname' => 'string',
'address' => 'string',
'street' => 'string',
'street_additional' => 'string',
'city' => 'string',
'state' => 'string',
'country' => 'string',
'zipcode' => 'string',
'latitude' => 'string',
'longitude' => 'string',
'filter_class' => 'string'
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
];
}
class Location extends Model
{
use SoftDeletes;
public $table = 'locations';
protected $dates = ['deleted_at'];
public $fillable = [
'location_type',
'nickname',
'address',
'street',
'street_additional',
'city',
'state',
'country',
'zipcode',
'latitude',
'longitude',
'filter_class'
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'location_type' => 'string',
'nickname' => 'string',
'address' => 'string',
'street' => 'string',
'street_additional' => 'string',
'city' => 'string',
'state' => 'string',
'country' => 'string',
'zipcode' => 'string',
'latitude' => 'string',
'longitude' => 'string',
'filter_class' => 'string'
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
];
}
@phillipmadsen which branch you are using ? Can you explain it in more detailed steps ?
@phillipmadsen and if you are master
branch, the refer my comment here. https://github.com/InfyOmLabs/laravel-generator/issues/324#issuecomment-252400379
I have the same problem, I'm using the boilerplate.
To reproduce the error:
generate from table:
php artisan infyom:api_scaffold cat_item --fromTable --tableName=cat_item
About the environment: Windows, php 5.6.24 under xampp
composer.json:
"require": { "php": ">=5.5.9", "laravel/framework": "5.2.", "yajra/laravel-datatables-oracle": "~6.0", "barryvdh/laravel-ide-helper": "^2.1", "infyomlabs/laravel-generator": "5.2.x-dev", "laravelcollective/html": "5.2.", "infyomlabs/adminlte-templates": "5.2.x-dev", "infyomlabs/swagger-generator": "dev-master", "jlapp/swaggervel": "dev-master", "doctrine/dbal": "~2.3" }, "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.", "phpunit/phpunit": "~4.0", "symfony/css-selector": "2.8.|3.0.", "symfony/dom-crawler": "2.8.|3.0.*" },
It output this into the model: