vendredi 29 septembre 2017

laravel upload image info failing noob here

hi there guys im not very good a laravel iv started 5 days ago,so i'm trying to upload some image info it work when i leave the code like this i get only null on the map field ....rest works

<label class="label-main"></label>

                        <div class="row">
                            <label class="col-md-5 control-label"></label>
                            <input type="text" class="col-md-7 input-sm instant-edit" name="photo[exif][zresta]" placeholder="Set Camera" value=""/>
                        </div>

                        <div class="row">
                            <label class="col-md-5 control-label"></label>
                            <input type="text" class="col-md-7 input-sm instant-edit" name="photo[exif][zcity]" placeholder="Set city" value=""/>
                        </div>

                        <div class="row">
                            <label class="col-md-5 control-label"></label>
                            <input type="text" class="col-md-7 input-sm instant-edit" name="photo[exif][wcountry]" placeholder="Set Focal Length" value=""/>
                        </div>

but when i change the code to this

<label class="label-main"></label>

                        <div class="row">
                            <label class="col-md-5 control-label"></label>
                            <input type="text" class="col-md-7 input-sm instant-edit" name="photo[exif][wrest]" placeholder="Resta" value=""/>
                        </div>

                        <div class="row">
                            <label class="col-md-5 control-label"></label>
                            <input type="text" class="col-md-7 input-sm instant-edit" name="photo[exif][zcity]" placeholder="Set Lens" value=""/>
                        </div>

                        <div class="row">
                            <label class="col-md-5 control-label"></label>
                            <input type="text" class="col-md-7 input-sm instant-edit" name="photo[exif][zcountry]" placeholder="Set Focal Length" value=""/>
                        </div>

the upload says upload fail

my img_info

class ImageInfo extends Model

{

use SoftDeletes;
/**
 * @var string
 */
protected $table = 'image_info';
/**
 * @var array
 */
protected $fillable = ['whatrest', 'wcity', 'wcountry', 'latitude', 'longitude'];

/**
 * @return array
 */
public function getDates()
{
    return ['created_at', 'updated_at', 'deleted_at'];
}

/**
 * @return mixed
 */
public function image()
{
    return $this->belongsTo(Image::class);
}

}

my upload` $exif = [ 'blah' => (isset($exif['blah']) && strlen($exif['blah']) > 0 ? $exif['blah'] : null), 'blahhh' => (isset($exif['blahhh']) && strlen($exif['lens']) > 0 ? $exif['lens'] : null), 'blahhh' => (isset($exif['blahhh']) && strlen($exif['blahh']) > 0 ? $exif['blahh'] : null),

        'latitude'      => $latitude,
        'longitude'     => $longitude,
    ];`



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire