mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 03:27:30 -04:00 
			
		
		
		
	* Wired up Bulk Archive / Delete / Restore button with reactivity on checkbox actions * Working on POSTing bulk actions * Working on Filtering by status * Add Action Entity * Implement Vuex for state management * Implement Vuex storage & list view bulk actions * Clean up console logs * Configure entity list views server side
		
			
				
	
	
		
			41 lines
		
	
	
		
			726 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			726 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Jobs\Entity;
 | |
| 
 | |
| use App\Repositories\BaseRepository;
 | |
| use Illuminate\Database\Eloquent\Model;
 | |
| use Illuminate\Foundation\Bus\Dispatchable;
 | |
| use Illuminate\Http\Request;
 | |
| use Illuminate\Support\Facades\Log;
 | |
| 
 | |
| class ActionEntity
 | |
| {
 | |
|     use Dispatchable;
 | |
| 
 | |
|     protected $action;
 | |
| 
 | |
|     protected $entity;
 | |
| 
 | |
|     /**
 | |
|      * Create a new job instance.
 | |
|      *
 | |
|      * @return void
 | |
|      */
 | |
| 
 | |
|     public function __construct(Model $entity, string $action)
 | |
|     {
 | |
|         $this->action = $action;
 | |
|         $this->entity = $entity;
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * Execute the job.
 | |
|      *
 | |
|      * @return void
 | |
|      */
 | |
|     public function handle(BaseRepository $baseRepo)
 | |
|     {
 | |
|         return $baseRepo->{$this->action}($this->entity);
 | |
|     }
 | |
| }
 |