laravel-generator icon indicating copy to clipboard operation
laravel-generator copied to clipboard

[Enhancement]: Possible addon to File_util.php and file.stub

Open phillipmadsen opened this issue 8 years ago • 1 comments

Should configure file.stub to use preview and path with extension for the file field.

{
    "fieldInput": "attachment:string",
    "htmlType": "file",
    "usePath": "public|storage",
    "pubPath": "/uploads/%MODALNAME%/%FIELDNAME%",  
    "storagePath": "/%MODALNAME%/%FIELDNAME%",
    "validations": "JPG,GIF,PNG",
  /*  "example sizes": "sizelabel:{primary_image}:width:{700},height:{300} ," */
    "sizes": "primary_image:700,300 thumbnail:250,250 admin_image:1200,500",
    "searchable": true,
    "fillable": true,
    "primary": false,
    "inForm": true,
    "inIndex": false
},

_My stub would generates something like this:_

<tr>
    <td style="width:20%">
        <a href="http://placehold.it/1000x600?text=Admin+View" class="magnific" title=" ">  //large image
             <img src="http://placehold.it/300x180?text=Admin+thumb" alt=" " class=" ">  // preview in form image
        </a>
    </td>
    <td><input type="text" class="form-control m-t-10" value="{%FIELD_NAME%-IMAGE}" ></td>
    <td><input type="checkbox" name="{primary image}" value="1" class="m-t-10"></td>
    <td><input type="checkbox" name="{thumbnail}" value="1" class="m-t-10"></td>
    <td><input type="checkbox" name="{admin_image}" value="1" class="m-t-10" checked></td>
    <td class="text-center">
        <a href="#" class="delete-img btn btn-sm btn-default m-t-10"> <i class="fa fa-times-circle"></i>
         Remove
        </a>
    </td>
</tr>

file stub concept

phillipmadsen avatar Apr 05 '16 21:04 phillipmadsen

  • any update on this?

rebootcode avatar Feb 23 '19 10:02 rebootcode