- 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
This commit is contained in:
29
app/Repositories/Revision.php
Normal file
29
app/Repositories/Revision.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user