Attachment model and database changes.

This commit is contained in:
James Cole
2015-07-18 09:49:19 +02:00
parent a34782575f
commit b0beab4cd3
4 changed files with 98 additions and 0 deletions

36
app/Models/Attachment.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Attachment
*
* @package FireflyIII\Models
*/
class Attachment extends Model
{
use SoftDeletes;
protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'md5', 'filename', 'mime', 'size', 'uploaded'];
/**
* Get all of the owning imageable models.
*/
public function attachable()
{
return $this->morphTo();
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo('FireflyIII\User');
}
}