Some checks failed
continuous-integration/drone/push Build is failing
- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
30 lines
523 B
PHP
30 lines
523 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Revision extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected $appends = ['hasChanges'];
|
|
|
|
protected $with = array('user', 'revisor');
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function revisor()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function getHasChangesAttribute()
|
|
{
|
|
return $this->updated_at != $this->accepted_at;
|
|
}
|
|
}
|