added UpdateEmailTemplate and DeleteEmailTemplate jobs
				
					
				
			This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Jobs\Common;
 | 
			
		||||
namespace App\Jobs\Setting;
 | 
			
		||||
 | 
			
		||||
use App\Abstracts\Job;
 | 
			
		||||
use App\Interfaces\Job\HasOwner;
 | 
			
		||||
							
								
								
									
										18
									
								
								app/Jobs/Setting/DeleteEmailTemplate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/Jobs/Setting/DeleteEmailTemplate.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Jobs\Setting;
 | 
			
		||||
 | 
			
		||||
use App\Abstracts\Job;
 | 
			
		||||
use App\Interfaces\Job\ShouldDelete;
 | 
			
		||||
 | 
			
		||||
class DeleteEmailTemplate extends Job implements ShouldDelete
 | 
			
		||||
{
 | 
			
		||||
    public function handle(): bool
 | 
			
		||||
    {
 | 
			
		||||
        \DB::transaction(function () {
 | 
			
		||||
            $this->model->delete();
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								app/Jobs/Setting/UpdateEmailTemplate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								app/Jobs/Setting/UpdateEmailTemplate.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Jobs\Setting;
 | 
			
		||||
 | 
			
		||||
use App\Abstracts\Job;
 | 
			
		||||
use App\Interfaces\Job\ShouldUpdate;
 | 
			
		||||
use App\Models\Common\EmailTemplate;
 | 
			
		||||
 | 
			
		||||
class UpdateEmailTemplate extends Job implements ShouldUpdate
 | 
			
		||||
{
 | 
			
		||||
    public function handle(): EmailTemplate
 | 
			
		||||
    {
 | 
			
		||||
        \DB::transaction(function () {
 | 
			
		||||
            $this->model->update($this->request->all());
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return $this->model;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user