pwweb / artomator

Artomator: Custom commands making life easier for Laravel.
MIT License
4 stars 1 forks source link

Published stub for fields.blade.php contains no fields #40

Closed frankpde closed 4 years ago

frankpde commented 4 years ago

The published stub for fields.blade.phpdoes not contain any fields. The show_fields.blade.php does however.

fields.blade.php

<!-- Submit Field -->
<div class="form-group col-sm-12">
    {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
    <a href="{{ route('documents.versions.index') }}" class="btn btn-secondary">Cancel</a>
</div>

show_fields.blade.php


<!-- Author Id Field -->
<div class="form-group">
    {!! Form::label('author_id', 'Author Id:') !!}
    <p>{{ $version->author_id }}</p>
</div>

<!-- Summary Field -->
<div class="form-group">
    {!! Form::label('summary', 'Summary:') !!}
    <p>{{ $version->summary }}</p>
</div>

<!-- Created At Field -->
<div class="form-group">
    {!! Form::label('created_at', 'Created At:') !!}
    <p>{{ $version->created_at }}</p>
</div>

<!-- Updated At Field -->
<div class="form-group">
    {!! Form::label('updated_at', 'Updated At:') !!}
    <p>{{ $version->updated_at }}</p>
</div>
rabrowne85 commented 4 years ago

I'm going to need more information to determine what's going on here:

  1. What was the exact command that you ran?
  2. What did you provide when prompted to enter information?
frankpde commented 4 years ago
$ php artisan artomator:graphql_scaffold MyModel --prefix=MyPrefix --tableName=my_table_name

Specify fields for the model (skip id & timestamp fields, we will add it automatically)
Read docs carefully to specify field inputs)
Enter "exit" to finish

 Field: (name db_type html_type options) []:
 > user_id bigInteger

 Enter validations:  []:
 > integer

 Field: (name db_type html_type options) []:
 > recipe_id bigInteger

 Enter validations:  []:
 > integer

 Field: (name db_type html_type options) []:
 > 
rabrowne85 commented 4 years ago

Looking at the input you’re providing, you’re not specifying the field type which probably explains why it’s not working.

The requested information is: name, db type, html type, options.

I.e. product_name string,255 text

Documentation here: https://labs.infyom.com/laravelgenerator/docs/7.0/getting-started#field-inputs