for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* GitScrum v0.1.
*
* @author Renato Marinho <[email protected]>
* @license http://opensource.org/licenses/GPL-3.0 GPLv3
*/
namespace GitScrum\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Attachment extends Model
{
use SoftDeletes;
* The database table used by the model.
* @var string
protected $table = 'attachments';
* Attributes that should be mass-assignable.
* @var array
protected $fillable = ['attachmentable_type', 'attachmentable_id', 'user_id',
'filename_original', 'filename_new', 'mimetype', 'size', ];
* The attributes excluded from the model's JSON form.
protected $hidden = [];
* The attributes that should be casted to native types.
protected $casts = [];
* The attributes that should be mutated to dates.
protected $dates = ['deleted_at'];
protected static function boot()
parent::boot();
}
public function attachmentable()
return $this->morphTo('attachmentable');
public function user()
return $this->belongsTo(\GitScrum\Models\User::class, 'user_id', 'id');