v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace App\Jobs\Banking;
use App\Abstracts\Job;
use App\Models\Setting\Category;
class DeleteTransaction extends Job
{
protected $transaction;
/**
* Create a new job instance.
*
* @param $transaction
*/
public function __construct($transaction)
{
$this->transaction = $transaction;
}
/**
* Execute the job.
*
* @return boolean|Exception
*/
public function handle()
{
$this->authorize();
$this->transaction->recurring()->delete();
$this->transaction->delete();
return true;
}
/**
* Determine if this action is applicable.
*
* @return void
*/
public function authorize()
{
if ($this->transaction->category->id == Category::transfer()) {
throw new \Exception('Unauthorized');
}
}
}