first commit
This commit is contained in:
24
app/Models/Approval.php
Normal file
24
app/Models/Approval.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Approval extends Model
|
||||
{
|
||||
protected $casts = [
|
||||
'metadata' => 'array',
|
||||
'step' => ApprovalStep::class
|
||||
];
|
||||
|
||||
public function transitionTo($status, $comment = null)
|
||||
{
|
||||
$this->update([
|
||||
'status' => $status,
|
||||
'comment' => $comment,
|
||||
'completed_at' => now()
|
||||
]);
|
||||
|
||||
$this->document->notifyApprovers();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user