Fix conflitto Eloquent
This commit is contained in:
parent
69071050f0
commit
ad21ebf9f2
|
@ -134,7 +134,7 @@ switch (post('op')) {
|
|||
$dst = $src;
|
||||
} else {
|
||||
$src = basename($fattura->uploads()->where('name', 'Fattura Elettronica')->first()->filepath);
|
||||
$dst = basename($fattura->uploads()->where('name', 'Fattura Elettronica')->first()->original);
|
||||
$dst = basename($fattura->uploads()->where('name', 'Fattura Elettronica')->first()->original_name);
|
||||
}
|
||||
|
||||
$file = slashes($module->upload_directory.'/'.$src);
|
||||
|
|
|
@ -31,7 +31,7 @@ class Upload extends Model
|
|||
$model = parent::build();
|
||||
|
||||
// Informazioni di base
|
||||
$model->attributes['original'] = $original_name; // Fix per original di Eloquent
|
||||
$model->original_name = $original_name; // Fix per original di Eloquent
|
||||
$model->size = $source['size'];
|
||||
|
||||
$model->name = !empty($name) ? $name : $original_name;
|
||||
|
@ -103,6 +103,19 @@ class Upload extends Model
|
|||
return $this->directory.'/'.$this->filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getOriginalNameAttribute()
|
||||
{
|
||||
return $this->attributes['original'];
|
||||
}
|
||||
|
||||
public function setOriginalNameAttribute($value)
|
||||
{
|
||||
$this->attributes['original'] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
|
2
view.php
2
view.php
|
@ -18,7 +18,7 @@ if ($file->isFatturaElettronica()) {
|
|||
// Individuazione stylesheet
|
||||
$default_stylesheet = 'asso-invoice';
|
||||
|
||||
$name = basename($file->original);
|
||||
$name = basename($file->original_name);
|
||||
$filename = explode('.', $name)[0];
|
||||
$pieces = explode('_', $filename);
|
||||
$stylesheet = $pieces[2];
|
||||
|
|
Loading…
Reference in New Issue