mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
migration for client registration fields
This commit is contained in:
parent
33df867438
commit
52d4997945
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Company;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Company::query()->cursor()->each(function ($company){
|
||||
|
||||
$crfs = $company->client_registration_fields;
|
||||
|
||||
foreach($crfs as $key => $crf)
|
||||
{
|
||||
$crfs[$key]['visible'] = $crfs[$key]['required'];
|
||||
}
|
||||
|
||||
$company->client_registration_fields = $crfs;
|
||||
$company->save();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user