add: full multi-tenancy control
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$now = Carbon::now();
|
||||
|
||||
DB::table('attributes')
|
||||
->insert([
|
||||
[
|
||||
'code' => 'name',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.name'),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'description',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.description'),
|
||||
'type' => 'textarea',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_name',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-name'),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '3',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_emails',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-emails'),
|
||||
'type' => 'email',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '4',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_numbers',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-numbers'),
|
||||
'type' => 'phone',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'numeric',
|
||||
'sort_order' => '5',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_address',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-address'),
|
||||
'type' => 'address',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '6',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('attributes', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$now = Carbon::now();
|
||||
|
||||
DB::table('attributes')
|
||||
->insert([
|
||||
[
|
||||
'code' => 'user_id',
|
||||
'name' => trans('installer::app.seeders.attributes.organizations.sales-owner'),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'organizations',
|
||||
'lookup_type' => 'users',
|
||||
'validation' => null,
|
||||
'sort_order' => '5',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void {}
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$now = Carbon::now();
|
||||
|
||||
DB::table('attributes')
|
||||
->insert([
|
||||
[
|
||||
'code' => 'job_title',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.job-title'),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '4',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void {}
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$now = Carbon::now();
|
||||
|
||||
DB::table('attributes')
|
||||
->insert([
|
||||
[
|
||||
'code' => 'user_id',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.sales-owner'),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => 'users',
|
||||
'validation' => null,
|
||||
'sort_order' => '5',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void {}
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$now = Carbon::now();
|
||||
|
||||
DB::table('attributes')
|
||||
->insert([
|
||||
[
|
||||
'code' => 'lead_pipeline_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.pipeline'),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'lead_pipelines',
|
||||
'validation' => null,
|
||||
'sort_order' => '9',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'lead_pipeline_stage_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.stage'),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'lead_pipeline_stages',
|
||||
'validation' => null,
|
||||
'sort_order' => '10',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,645 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Attribute;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AttributeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('attributes')->delete();
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('attributes')->insert([
|
||||
/**
|
||||
* Leads Attributes
|
||||
*/
|
||||
[
|
||||
'code' => 'title',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.title', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'description',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.description', [], $defaultLocale),
|
||||
'type' => 'textarea',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'lead_value',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.lead-value', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '3',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'lead_source_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.source', [], $defaultLocale),
|
||||
'type' => 'select',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'lead_sources',
|
||||
'validation' => null,
|
||||
'sort_order' => '4',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'lead_type_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.type', [], $defaultLocale),
|
||||
'type' => 'select',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'lead_types',
|
||||
'validation' => null,
|
||||
'sort_order' => '5',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'user_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.sales-owner', [], $defaultLocale),
|
||||
'type' => 'select',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'users',
|
||||
'validation' => null,
|
||||
'sort_order' => '7',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'expected_close_date',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.expected-close-date', [], $defaultLocale),
|
||||
'type' => 'date',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '8',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'lead_pipeline_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.pipeline', [], $defaultLocale),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'lead_pipelines',
|
||||
'validation' => null,
|
||||
'sort_order' => '9',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'lead_pipeline_stage_id',
|
||||
'name' => trans('installer::app.seeders.attributes.leads.stage', [], $defaultLocale),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'leads',
|
||||
'lookup_type' => 'lead_pipeline_stages',
|
||||
'validation' => null,
|
||||
'sort_order' => '10',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
|
||||
/**
|
||||
* Persons Attributes
|
||||
*/
|
||||
[
|
||||
'code' => 'name',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.name', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'emails',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.emails', [], $defaultLocale),
|
||||
'type' => 'email',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_numbers',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.contact-numbers', [], $defaultLocale),
|
||||
'type' => 'phone',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'numeric',
|
||||
'sort_order' => '3',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'job_title',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.job-title', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '4',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'user_id',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.sales-owner', [], $defaultLocale),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => 'users',
|
||||
'validation' => null,
|
||||
'sort_order' => '5',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'organization_id',
|
||||
'name' => trans('installer::app.seeders.attributes.persons.organization', [], $defaultLocale),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'persons',
|
||||
'lookup_type' => 'organizations',
|
||||
'validation' => null,
|
||||
'sort_order' => '6',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
|
||||
/**
|
||||
* Organizations Attributes
|
||||
*/
|
||||
[
|
||||
'code' => 'name',
|
||||
'name' => trans('installer::app.seeders.attributes.organizations.name', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'organizations',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'address',
|
||||
'name' => trans('installer::app.seeders.attributes.organizations.address', [], $defaultLocale),
|
||||
'type' => 'address',
|
||||
'entity_type' => 'organizations',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'user_id',
|
||||
'name' => trans('installer::app.seeders.attributes.organizations.sales-owner', [], $defaultLocale),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'organizations',
|
||||
'lookup_type' => 'users',
|
||||
'validation' => null,
|
||||
'sort_order' => '3',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
|
||||
/**
|
||||
* Products Attributes
|
||||
*/
|
||||
[
|
||||
'code' => 'name',
|
||||
'name' => trans('installer::app.seeders.attributes.products.name', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'products',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'description',
|
||||
'name' => trans('installer::app.seeders.attributes.products.description', [], $defaultLocale),
|
||||
'type' => 'textarea',
|
||||
'entity_type' => 'products',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'sku',
|
||||
'name' => trans('installer::app.seeders.attributes.products.sku', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'products',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '3',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'quantity',
|
||||
'name' => trans('installer::app.seeders.attributes.products.quantity', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'products',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'numeric',
|
||||
'sort_order' => '4',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'price',
|
||||
'name' => trans('installer::app.seeders.attributes.products.price', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'products',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '5',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
|
||||
/**
|
||||
* Quotes Attributes
|
||||
*/
|
||||
[
|
||||
'code' => 'user_id',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.sales-owner', [], $defaultLocale),
|
||||
'type' => 'select',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => 'users',
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'subject',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.subject', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'description',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.description', [], $defaultLocale),
|
||||
'type' => 'textarea',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '3',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'billing_address',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.billing-address', [], $defaultLocale),
|
||||
'type' => 'address',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '4',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'shipping_address',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.shipping-address', [], $defaultLocale),
|
||||
'type' => 'address',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '5',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'discount_percent',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.discount-percent', [], $defaultLocale),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '6',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'discount_amount',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.discount-amount', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '7',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'tax_amount',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.tax-amount', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '8',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'adjustment_amount',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.adjustment-amount', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '9',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'sub_total',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.sub-total', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '10',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'grand_total',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.grand-total', [], $defaultLocale),
|
||||
'type' => 'price',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'decimal',
|
||||
'sort_order' => '11',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'expired_at',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.expired-at', [], $defaultLocale),
|
||||
'type' => 'date',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '12',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'person_id',
|
||||
'name' => trans('installer::app.seeders.attributes.quotes.person', [], $defaultLocale),
|
||||
'type' => 'lookup',
|
||||
'entity_type' => 'quotes',
|
||||
'lookup_type' => 'persons',
|
||||
'validation' => null,
|
||||
'sort_order' => '13',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
|
||||
/**
|
||||
* Warehouses Attributes
|
||||
*/
|
||||
[
|
||||
'code' => 'name',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.name'),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '1',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'description',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.description'),
|
||||
'type' => 'textarea',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '2',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_name',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-name'),
|
||||
'type' => 'text',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '3',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_emails',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-emails'),
|
||||
'type' => 'email',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '4',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_numbers',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-numbers'),
|
||||
'type' => 'phone',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => 'numeric',
|
||||
'sort_order' => '5',
|
||||
'is_required' => '0',
|
||||
'is_unique' => '1',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'code' => 'contact_address',
|
||||
'name' => trans('installer::app.seeders.attributes.warehouses.contact-address'),
|
||||
'type' => 'address',
|
||||
'entity_type' => 'warehouses',
|
||||
'lookup_type' => null,
|
||||
'validation' => null,
|
||||
'sort_order' => '6',
|
||||
'is_required' => '1',
|
||||
'is_unique' => '0',
|
||||
'quick_add' => '1',
|
||||
'is_user_defined' => '0',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Attribute;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(AttributeSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Core;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CountriesSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('countries')->delete();
|
||||
|
||||
$countries = json_decode(file_get_contents(__DIR__.'/../../../Data/countries.json'), true);
|
||||
|
||||
DB::table('countries')->insert($countries);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Core;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(CountriesSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(StatesSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Core;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class StatesSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('country_states')->delete();
|
||||
|
||||
$states = json_decode(file_get_contents(__DIR__.'/../../../Data/states.json'), true);
|
||||
|
||||
DB::table('country_states')->insert($states);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Webkul\Installer\Database\Seeders\Attribute\DatabaseSeeder as AttributeSeeder;
|
||||
use Webkul\Installer\Database\Seeders\Core\DatabaseSeeder as CoreSeeder;
|
||||
use Webkul\Installer\Database\Seeders\EmailTemplate\DatabaseSeeder as EmailTemplateSeeder;
|
||||
use Webkul\Installer\Database\Seeders\Lead\DatabaseSeeder as LeadSeeder;
|
||||
use Webkul\Installer\Database\Seeders\User\DatabaseSeeder as UserSeeder;
|
||||
use Webkul\Installer\Database\Seeders\Workflow\DatabaseSeeder as WorkflowSeeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(AttributeSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(CoreSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(EmailTemplateSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(LeadSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(UserSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(WorkflowSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\EmailTemplate;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(EmailTemplateSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\EmailTemplate;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class EmailTemplateSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('email_templates')->delete();
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('email_templates')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => trans('installer::app.seeders.email.activity-created', [], $defaultLocale),
|
||||
'subject' => trans('installer::app.seeders.email.activity-created', [], $defaultLocale).': {%activities.title%}',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
'content' => '<p style="font-size: 16px; color: #5e5e5e;">'.trans('installer::app.seeders.email.new-activity', [], $defaultLocale).':</p>
|
||||
<p><strong style="font-size: 16px;">Details</strong></p>
|
||||
<table style="height: 97px; width: 952px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px;">'.trans('installer::app.seeders.email.title', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.title%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px;">'.trans('installer::app.seeders.email.type', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.type%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px;">'.trans('installer::app.seeders.email.date', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.schedule_from%} to {%activities.schedule_to%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px; vertical-align: text-top;">'.trans('installer::app.seeders.email.participants', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.participants%}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>',
|
||||
], [
|
||||
'id' => 2,
|
||||
'name' => trans('installer::app.seeders.email.activity-modified', [], $defaultLocale),
|
||||
'subject' => trans('installer::app.seeders.email.activity-modified', [], $defaultLocale).': {%activities.title%}',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
'content' => '<p style="font-size: 16px; color: #5e5e5e;">'.trans('installer::app.seeders.email.new-activity-modified', [], $defaultLocale).':</p>
|
||||
<p><strong style="font-size: 16px;">Details</strong></p>
|
||||
<table style="height: 97px; width: 952px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px;">'.trans('installer::app.seeders.email.title', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.title%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px;">'.trans('installer::app.seeders.email.type', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.type%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px;">'.trans('installer::app.seeders.email.date', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.schedule_from%} to {%activities.schedule_to%}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 116.953px; color: #546e7a; font-size: 16px; vertical-align: text-top;">'.trans('installer::app.seeders.email.participants', [], $defaultLocale).'</td>
|
||||
<td style="width: 770.047px; font-size: 16px;">{%activities.participants%}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Lead;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(PipelineSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(TypeSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(SourceSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Lead;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PipelineSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('lead_pipelines')->delete();
|
||||
|
||||
DB::table('lead_pipeline_stages')->delete();
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('lead_pipelines')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.default', [], $defaultLocale),
|
||||
'is_default' => 1,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
|
||||
DB::table('lead_pipeline_stages')->insert($data = [
|
||||
[
|
||||
'id' => 1,
|
||||
'code' => 'new',
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.pipeline-stages.new', [], $defaultLocale),
|
||||
'probability' => 100,
|
||||
'sort_order' => 1,
|
||||
'lead_pipeline_id' => 1,
|
||||
], [
|
||||
'id' => 2,
|
||||
'code' => 'follow-up',
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.pipeline-stages.follow-up', [], $defaultLocale),
|
||||
'probability' => 100,
|
||||
'sort_order' => 2,
|
||||
'lead_pipeline_id' => 1,
|
||||
], [
|
||||
'id' => 3,
|
||||
'code' => 'prospect',
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.pipeline-stages.prospect', [], $defaultLocale),
|
||||
'probability' => 100,
|
||||
'sort_order' => 3,
|
||||
'lead_pipeline_id' => 1,
|
||||
], [
|
||||
'id' => 4,
|
||||
'code' => 'negotiation',
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.pipeline-stages.negotiation', [], $defaultLocale),
|
||||
'probability' => 100,
|
||||
'sort_order' => 4,
|
||||
'lead_pipeline_id' => 1,
|
||||
], [
|
||||
'id' => 5,
|
||||
'code' => 'won',
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.pipeline-stages.won', [], $defaultLocale),
|
||||
'probability' => 100,
|
||||
'sort_order' => 5,
|
||||
'lead_pipeline_id' => 1,
|
||||
], [
|
||||
'id' => 6,
|
||||
'code' => 'lost',
|
||||
'name' => trans('installer::app.seeders.lead.pipeline.pipeline-stages.lost', [], $defaultLocale),
|
||||
'probability' => 0,
|
||||
'sort_order' => 6,
|
||||
'lead_pipeline_id' => 1,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Lead;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SourceSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('lead_sources')->delete();
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('lead_sources')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => trans('installer::app.seeders.lead.source.email', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'id' => 2,
|
||||
'name' => trans('installer::app.seeders.lead.source.web', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'id' => 3,
|
||||
'name' => trans('installer::app.seeders.lead.source.web-form', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'id' => 4,
|
||||
'name' => trans('installer::app.seeders.lead.source.phone', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'id' => 5,
|
||||
'name' => trans('installer::app.seeders.lead.source.direct', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Lead;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class TypeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('lead_types')->delete();
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('lead_types')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => trans('installer::app.seeders.lead.type.new-business', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'id' => 2,
|
||||
'name' => trans('installer::app.seeders.lead.type.existing-business', [], $defaultLocale),
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\User;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(RoleSeeder::class, false, ['parameters' => $parameters]);
|
||||
$this->call(UserSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\User;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RoleSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('users')->delete();
|
||||
|
||||
DB::table('roles')->delete();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('roles')->insert([
|
||||
'id' => 1,
|
||||
'name' => trans('installer::app.seeders.user.role.administrator', [], $defaultLocale),
|
||||
'description' => trans('installer::app.seeders.user.role.administrator-role', [], $defaultLocale),
|
||||
'permission_type' => 'all',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\User;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('users')->delete();
|
||||
|
||||
DB::table('users')->insert([
|
||||
'id' => 1,
|
||||
'name' => 'Example Admin',
|
||||
'email' => 'admin@example.com',
|
||||
'password' => bcrypt('admin123'),
|
||||
// 'api_token' => Str::random(80),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'status' => 1,
|
||||
'role_id' => 1,
|
||||
'view_permission' => 'global',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Workflow;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
$this->call(WorkflowSeeder::class, false, ['parameters' => $parameters]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Webkul\Installer\Database\Seeders\Workflow;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class WorkflowSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function run($parameters = [])
|
||||
{
|
||||
DB::table('workflows')->delete();
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
$defaultLocale = $parameters['locale'] ?? config('app.locale');
|
||||
|
||||
DB::table('workflows')->insert([
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => trans('installer::app.seeders.workflow.email-to-participants-after-activity-creation', [], $defaultLocale),
|
||||
'description' => trans('installer::app.seeders.workflow.email-to-participants-after-activity-creation', [], $defaultLocale),
|
||||
'entity_type' => 'activities',
|
||||
'event' => 'activity.create.after',
|
||||
'condition_type' => 'and',
|
||||
'conditions' => '[{"value": ["call", "meeting", "lunch"], "operator": "{}", "attribute": "type", "attribute_type": "multiselect"}]',
|
||||
'actions' => '[{"id": "send_email_to_participants", "value": "1"}]',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
], [
|
||||
'id' => 2,
|
||||
'name' => trans('installer::app.seeders.workflow.email-to-participants-after-activity-updation', [], $defaultLocale),
|
||||
'description' => trans('installer::app.seeders.workflow.email-to-participants-after-activity-updation', [], $defaultLocale),
|
||||
'entity_type' => 'activities',
|
||||
'event' => 'activity.update.after',
|
||||
'condition_type' => 'and',
|
||||
'conditions' => '[{"value": ["call", "meeting", "lunch"], "operator": "{}", "attribute": "type", "attribute_type": "multiselect"}]',
|
||||
'actions' => '[{"id": "send_email_to_participants", "value": "2"}]',
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user