mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-02 22:57:33 -05:00 
			
		
		
		
	Support multiple migrations at once
This commit is contained in:
		
							parent
							
								
									c4b147d7c8
								
							
						
					
					
						commit
						d24d2e4b93
					
				@ -2,22 +2,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace App\Http\Controllers\Migration;
 | 
					namespace App\Http\Controllers\Migration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use App\Models\User;
 | 
					 | 
				
			||||||
use App\Models\Credit;
 | 
					 | 
				
			||||||
use App\Models\Contact;
 | 
					 | 
				
			||||||
use App\Models\Invoice;
 | 
					 | 
				
			||||||
use App\Models\Payment;
 | 
					 | 
				
			||||||
use App\Models\Product;
 | 
					 | 
				
			||||||
use App\Models\TaxRate;
 | 
					 | 
				
			||||||
use App\Libraries\Utils;
 | 
					use App\Libraries\Utils;
 | 
				
			||||||
use App\Models\Document;
 | 
					 | 
				
			||||||
use App\Models\PaymentMethod;
 | 
					 | 
				
			||||||
use App\Models\AccountGateway;
 | 
					 | 
				
			||||||
use App\Models\AccountGatewayToken;
 | 
					 | 
				
			||||||
use App\Traits\GenerateMigrationResources;
 | 
					use App\Traits\GenerateMigrationResources;
 | 
				
			||||||
use Illuminate\Support\Facades\Auth;
 | 
					use Illuminate\Support\Facades\Auth;
 | 
				
			||||||
use Illuminate\Support\Facades\Crypt;
 | 
					 | 
				
			||||||
use App\Models\AccountGatewaySettings;
 | 
					 | 
				
			||||||
use App\Services\Migration\AuthService;
 | 
					use App\Services\Migration\AuthService;
 | 
				
			||||||
use App\Http\Controllers\BaseController;
 | 
					use App\Http\Controllers\BaseController;
 | 
				
			||||||
use App\Services\Migration\CompanyService;
 | 
					use App\Services\Migration\CompanyService;
 | 
				
			||||||
@ -26,6 +13,7 @@ use App\Http\Requests\MigrationTypeRequest;
 | 
				
			|||||||
use App\Services\Migration\CompleteService;
 | 
					use App\Services\Migration\CompleteService;
 | 
				
			||||||
use App\Http\Requests\MigrationEndpointRequest;
 | 
					use App\Http\Requests\MigrationEndpointRequest;
 | 
				
			||||||
use App\Http\Requests\MigrationCompaniesRequest;
 | 
					use App\Http\Requests\MigrationCompaniesRequest;
 | 
				
			||||||
 | 
					use App\Models\Account;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class StepsController extends BaseController
 | 
					class StepsController extends BaseController
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -159,8 +147,7 @@ class StepsController extends BaseController
 | 
				
			|||||||
            );
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $companyService = (new CompanyService(session('MIGRATION_ACCOUNT_TOKEN')))
 | 
					        $companyService = (new CompanyService())
 | 
				
			||||||
            ->endpoint(session('MIGRATION_ENDPOINT'))
 | 
					 | 
				
			||||||
            ->start();
 | 
					            ->start();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($companyService->isSuccessful()) {
 | 
					        if ($companyService->isSuccessful()) {
 | 
				
			||||||
@ -180,15 +167,12 @@ class StepsController extends BaseController
 | 
				
			|||||||
            );
 | 
					            );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ($request->companies as $company) {
 | 
					        $migrationData = $this->generateMigrationData($request->all());
 | 
				
			||||||
            (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN')))
 | 
					
 | 
				
			||||||
                ->file($this->getMigrationFile())
 | 
					        $completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN')))
 | 
				
			||||||
                ->force(array_key_exists('force', $company))
 | 
					            ->data($migrationData)
 | 
				
			||||||
                ->company($company['id'])
 | 
					 | 
				
			||||||
            ->endpoint(session('MIGRATION_ENDPOINT'))
 | 
					            ->endpoint(session('MIGRATION_ENDPOINT'))
 | 
				
			||||||
                ->companyKey($request->account_key)
 | 
					 | 
				
			||||||
            ->start();
 | 
					            ->start();
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return view('migration.completed');
 | 
					        return view('migration.completed');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -224,9 +208,14 @@ class StepsController extends BaseController
 | 
				
			|||||||
     *
 | 
					     *
 | 
				
			||||||
     * @return string
 | 
					     * @return string
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public function getMigrationFile()
 | 
					    public function generateMigrationData(array $data): array
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->account = Auth::user()->account;
 | 
					        $migrationData = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        foreach ($data['companies'] as $company) {
 | 
				
			||||||
 | 
					            $account = Account::where('account_key', $company['id'])->firstOrFail();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $this->account = $account;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $date = date('Y-m-d');
 | 
					            $date = date('Y-m-d');
 | 
				
			||||||
            $accountKey = $this->account->account_key;
 | 
					            $accountKey = $this->account->account_key;
 | 
				
			||||||
@ -235,7 +224,7 @@ class StepsController extends BaseController
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            $fileName = "{$accountKey}-{$date}-invoiceninja";
 | 
					            $fileName = "{$accountKey}-{$date}-invoiceninja";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $data = [
 | 
					            $migrationData[$company['id']]['data'] = [
 | 
				
			||||||
                'company' => $this->getCompany(),
 | 
					                'company' => $this->getCompany(),
 | 
				
			||||||
                'users' => $this->getUsers(),
 | 
					                'users' => $this->getUsers(),
 | 
				
			||||||
                'tax_rates' => $this->getTaxRates(),
 | 
					                'tax_rates' => $this->getTaxRates(),
 | 
				
			||||||
@ -258,6 +247,8 @@ class StepsController extends BaseController
 | 
				
			|||||||
                'tasks' => $this->getTasks(),
 | 
					                'tasks' => $this->getTasks(),
 | 
				
			||||||
            ];
 | 
					            ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $migrationData[$company['id']]['force'] = array_key_exists('force', $company) ? true : false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $file = storage_path("migrations/{$fileName}.zip");
 | 
					            $file = storage_path("migrations/{$fileName}.zip");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $zip = new \ZipArchive();
 | 
					            $zip = new \ZipArchive();
 | 
				
			||||||
@ -265,10 +256,13 @@ class StepsController extends BaseController
 | 
				
			|||||||
            $zip->addFromString('migration.json', json_encode($data, JSON_PRETTY_PRINT));
 | 
					            $zip->addFromString('migration.json', json_encode($data, JSON_PRETTY_PRINT));
 | 
				
			||||||
            $zip->close();
 | 
					            $zip->close();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $migrationData[$company['id']]['file'] = $file;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return $migrationData;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // header('Content-Type: application/zip');
 | 
					        // header('Content-Type: application/zip');
 | 
				
			||||||
        // header('Content-Length: ' . filesize($file));
 | 
					        // header('Content-Length: ' . filesize($file));
 | 
				
			||||||
        // header("Content-Disposition: attachment; filename={$fileName}.zip");
 | 
					        // header("Content-Disposition: attachment; filename={$fileName}.zip");
 | 
				
			||||||
 | 
					 | 
				
			||||||
        return $file;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -2,46 +2,34 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace App\Services\Migration;
 | 
					namespace App\Services\Migration;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use App\Models\Account;
 | 
				
			||||||
use Unirest\Request;
 | 
					use Unirest\Request;
 | 
				
			||||||
use Unirest\Request\Body;
 | 
					use Unirest\Request\Body;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CompanyService
 | 
					class CompanyService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    protected $token;
 | 
					 | 
				
			||||||
    protected $endpoint = 'https://app.invoiceninja.com';
 | 
					 | 
				
			||||||
    protected $uri = '/api/v1/companies';
 | 
					 | 
				
			||||||
    protected $errors = [];
 | 
					 | 
				
			||||||
    protected $isSuccessful;
 | 
					    protected $isSuccessful;
 | 
				
			||||||
    protected $companies = [];
 | 
					    protected $companies = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function __construct(string $token)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $this->token = $token;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function endpoint(string $endpoint)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $this->endpoint = $endpoint;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return $this;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function start()
 | 
					    public function start()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $response = Request::get($this->getUrl(), $this->getHeaders());
 | 
					        try {
 | 
				
			||||||
 | 
					            foreach (session(SESSION_USER_ACCOUNTS) as $company) {
 | 
				
			||||||
 | 
					                $account = Account::find($company->account_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if ($account) {
 | 
				
			||||||
 | 
					                    $this->companies[] = [
 | 
				
			||||||
 | 
					                        'id' => $company->account_id, 
 | 
				
			||||||
 | 
					                        'name' => $account->name,
 | 
				
			||||||
 | 
					                        'company_key' => $account->account_key, 
 | 
				
			||||||
 | 
					                    ];
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($response->code == 200) {
 | 
					 | 
				
			||||||
            $this->isSuccessful = true;
 | 
					            $this->isSuccessful = true;
 | 
				
			||||||
 | 
					        } catch (\Exception $th) {
 | 
				
			||||||
            foreach($response->body->data as $company) {
 | 
					 | 
				
			||||||
                $this->companies[] = $company;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (in_array($response->code, [401, 422, 500])) {
 | 
					 | 
				
			||||||
            $this->isSuccessful = false;
 | 
					            $this->isSuccessful = false;
 | 
				
			||||||
            $this->processErrors($response->body);
 | 
					            $this->errors = [];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $this;
 | 
					        return $this;
 | 
				
			||||||
@ -61,29 +49,8 @@ class CompanyService
 | 
				
			|||||||
        return [];
 | 
					        return [];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function getErrors()
 | 
					    public function getErrors()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return $this->errors;
 | 
					        return $this->errors;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
    private function getHeaders()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        return [
 | 
					 | 
				
			||||||
            'X-Requested-With' => 'XMLHttpRequest',
 | 
					 | 
				
			||||||
            'X-Api-Token' => $this->token,
 | 
					 | 
				
			||||||
        ];
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private function getUrl()
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        return $this->endpoint . $this->uri;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private function processErrors($errors)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $array = (array) $errors;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $this->errors = $array;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -9,37 +9,25 @@ use Unirest\Request\Body;
 | 
				
			|||||||
class CompleteService
 | 
					class CompleteService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    protected $token;
 | 
					    protected $token;
 | 
				
			||||||
    protected $company;
 | 
					
 | 
				
			||||||
    protected $file;
 | 
					 | 
				
			||||||
    protected $endpoint = 'https://app.invoiceninja.com';
 | 
					    protected $endpoint = 'https://app.invoiceninja.com';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected $uri = '/api/v1/migration/start/';
 | 
					    protected $uri = '/api/v1/migration/start/';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected $errors = [];
 | 
					    protected $errors = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected $isSuccessful;
 | 
					    protected $isSuccessful;
 | 
				
			||||||
    protected $force = false;
 | 
					
 | 
				
			||||||
    protected $companyKey;
 | 
					    protected $data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function __construct(string $token)
 | 
					    public function __construct(string $token)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->token = $token;
 | 
					        $this->token = $token;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function file($file)
 | 
					    public function data(array $data)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->file = $file;
 | 
					        $this->data = $data;
 | 
				
			||||||
 | 
					 | 
				
			||||||
        return $this;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function force($option)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $this->force = $option;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return $this;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function company($company)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $this->company = $company;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $this;
 | 
					        return $this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -51,26 +39,30 @@ class CompleteService
 | 
				
			|||||||
        return $this;
 | 
					        return $this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function companyKey(string $key)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        $this->companyKey = $key;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return $this;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function start()
 | 
					    public function start()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $body = [
 | 
					        $body = [
 | 
				
			||||||
            'migration' => \Unirest\Request\Body::file($this->file, 'application/zip'),
 | 
					            'companies' => [],
 | 
				
			||||||
            'force' => $this->force,
 | 
					 | 
				
			||||||
            'company_key' => $this->companyKey,
 | 
					 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $response = Request::post($this->getUrl(), $this->getHeaders(), $body);
 | 
					        foreach ($this->data as $companyKey => $companyData) {
 | 
				
			||||||
 | 
					            $body['companies'][] = [
 | 
				
			||||||
 | 
					                'company_key' => $companyKey,
 | 
				
			||||||
 | 
					                'migration' => \Unirest\Request\Body::file($companyData['file'], 'application/zip'),
 | 
				
			||||||
 | 
					                'force' => $companyData['force'],
 | 
				
			||||||
 | 
					            ];
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            $response = Request::post($this->getUrl(), $this->getHeaders(), json_encode($body));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            dd($response);
 | 
				
			||||||
 | 
					        } catch (\Exception $e) {
 | 
				
			||||||
 | 
					            dd($e->getMessage());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($response->code == 200) {
 | 
					        if ($response->code == 200) {
 | 
				
			||||||
            $this->isSuccessful = true;
 | 
					            $this->isSuccessful = true;
 | 
				
			||||||
            $this->deleteFile();
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (in_array($response->code, [401, 422, 500])) {
 | 
					        if (in_array($response->code, [401, 422, 500])) {
 | 
				
			||||||
@ -88,7 +80,6 @@ class CompleteService
 | 
				
			|||||||
        return $this->isSuccessful;
 | 
					        return $this->isSuccessful;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    public function getErrors()
 | 
					    public function getErrors()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return $this->errors;
 | 
					        return $this->errors;
 | 
				
			||||||
@ -105,11 +96,11 @@ class CompleteService
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private function getUrl()
 | 
					    private function getUrl()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return $this->endpoint . $this->uri . $this->company;
 | 
					        return "{$this->endpoint}/{$this->uri}";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function deleteFile()
 | 
					    public function deleteFile(string $path)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Storage::delete($this->file);
 | 
					        Storage::delete($path);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -3790,6 +3790,8 @@ $LANG = array(
 | 
				
			|||||||
    'tax_name1' => 'Tax Name 1',
 | 
					    'tax_name1' => 'Tax Name 1',
 | 
				
			||||||
    'tax_name2' => 'Tax Name 2',
 | 
					    'tax_name2' => 'Tax Name 2',
 | 
				
			||||||
    'transaction_id' => 'Transaction ID',
 | 
					    'transaction_id' => 'Transaction ID',
 | 
				
			||||||
 | 
					    'migration_select_company_label' => 'Awesome! Please select the companies you would like to migrate.',
 | 
				
			||||||
 | 
					    'force_migration' => 'Force migration',
 | 
				
			||||||
); 
 | 
					); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return $LANG;
 | 
					return $LANG;
 | 
				
			||||||
 | 
				
			|||||||
@ -11,22 +11,23 @@
 | 
				
			|||||||
            <h3 class="panel-title">{!! trans('texts.welcome_to_the_new_version') !!}</h3>
 | 
					            <h3 class="panel-title">{!! trans('texts.welcome_to_the_new_version') !!}</h3>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="panel-body">
 | 
					        <div class="panel-body">
 | 
				
			||||||
            <h4>Awesome! Please select the company you would like to apply migration.</h4>
 | 
					            <h4>{!! trans('texts.migration_select_company_label') !!}</h4>
 | 
				
			||||||
            <form action="{{ url('/migration/companies') }}" method="post" id="auth-form">
 | 
					            <form action="{{ url('/migration/companies') }}" method="post" id="auth-form">
 | 
				
			||||||
                {{ csrf_field() }}
 | 
					                {{ csrf_field() }}
 | 
				
			||||||
                <input type="hidden" name="account_key" value="{{ auth()->user()->account->account_key }}">
 | 
					                <input type="hidden" name="account_key" value="{{ auth()->user()->account->account_key }}">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                @foreach($companies as $company)
 | 
					                @foreach($companies as $company)
 | 
				
			||||||
                <div class="form-check">
 | 
					                <div class="form-check">
 | 
				
			||||||
                    <input class="form-check-input" id="company_{{ $company->id }}" type="checkbox" name="companies[{{ $company->id }}][id]" id="company1" value="{{ $company->id }}" checked>
 | 
					                    <input class="form-check-input" id="{{ $company['company_key'] }}" type="checkbox" name="companies[{{ $company['company_key'] }}][id]" value="{{ $company['company_key'] }}">
 | 
				
			||||||
                    <label class="form-check-label" for="company_{{ $company->id }}">
 | 
					                    <label class="form-check-label" for="{{ $company['company_key'] }}">
 | 
				
			||||||
                        Name: {{ $company->settings->name }} ID: {{ $company->id }}
 | 
					                        {{ $company['name'] }}
 | 
				
			||||||
                    </label>
 | 
					                    </label>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="form-group">
 | 
					                <div class="form-group">
 | 
				
			||||||
                    <input type="checkbox" name="companies[{{ $company->id }}][force]">
 | 
					                    <label for="companies[{{ $company['company_key'] }}][force]">
 | 
				
			||||||
                    <label for="force">Force migration</label>
 | 
					                        <input type="checkbox" id="companies[{{ $company['company_key'] }}][force]" name="companies[{{ $company['company_key'] }}][force]">
 | 
				
			||||||
                    <small>* All current company data will be wiped.</small>
 | 
					                        <small>{!! trans('texts.force_migration') !!}</small>
 | 
				
			||||||
 | 
					                    </label>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                @endforeach
 | 
					                @endforeach
 | 
				
			||||||
            </form>
 | 
					            </form>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user