InfyOmLabs / laravel-generator

API and Admin Panel CRUD Generator for Laravel.
https://www.infyom.com/open-source
MIT License
3.79k stars 814 forks source link

fresh adminlte output to model not working #322

Closed phillipmadsen closed 8 years ago

phillipmadsen commented 8 years ago

It output this into the model:

$SOFT_DELETE_IMPORT$
$DOCS$
class Location extends Model
{
$SOFT_DELETE$
    public $table = 'locations';

$SOFT_DELETE_DATES$
phillipmadsen commented 8 years ago

non development version

phillipmadsen commented 8 years ago

Actually it is creating the model output inside of another model output

phillipmadsen commented 8 years ago

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 = [

    ];

}
mitulgolakiya commented 8 years ago

@phillipmadsen which branch you are using ? Can you explain it in more detailed steps ?

mitulgolakiya commented 8 years ago

@phillipmadsen and if you are master branch, the refer my comment here. https://github.com/InfyOmLabs/laravel-generator/issues/324#issuecomment-252400379

olimaz commented 7 years ago

I have the same problem, I'm using the boilerplate.

To reproduce the error:

  1. Clone the repo
  2. 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.*" },