Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/dceprojects.corals.io/Corals/modules/ProjectPlan/update-batches/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/dceprojects.corals.io/Corals/modules/ProjectPlan/update-batches/1.2.php
<?php

use Corals\Modules\Utility\Models\ListOfValue\ListOfValue;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

Schema::table('pp_projects', function (Blueprint $table) {
    $table->unsignedInteger('owner_id')->nullable();
    $table->foreign('owner_id')->references('id')->on('users')
        ->cascadeOnUpdate();
});

DB::table('pp_projects')
    ->update(['owner_id' => DB::raw('created_by')]);

Schema::create('pp_hotels', function (Blueprint $table) {
    $table->increments('id');

    $table->string('name');
    $table->string('phone')->nullable();
    $table->string('email')->nullable();
    $table->string('address')->nullable();


    $table->text('properties')->nullable();
    $table->unsignedInteger('created_by')->nullable()->index();
    $table->unsignedInteger('updated_by')->nullable()->index();
    $table->softDeletes();
    $table->timestamps();
});

Schema::create('pp_project_hotel', function (Blueprint $table) {
    $table->increments('id');

    $table->unsignedInteger('project_id');
    $table->foreign('project_id')->references('id')->on('pp_projects')
        ->cascadeOnUpdate()->cascadeOnDelete();

    $table->unsignedInteger('hotel_id');

    $table->foreign('hotel_id')->references('id')->on('pp_hotels')
        ->cascadeOnUpdate()->cascadeOnDelete();

    $table->text('properties')->nullable();
    $table->unsignedInteger('created_by')->nullable()->index();
    $table->unsignedInteger('updated_by')->nullable()->index();
    $table->softDeletes();
    $table->timestamps();

});

Schema::create('pp_project_airfare', function (Blueprint $table) {
    $table->increments('id');

    $table->unsignedInteger('project_id');
    $table->foreign('project_id')->references('id')->on('pp_projects')
        ->cascadeOnUpdate()->cascadeOnDelete();

    $table->string('airfare_code');

    $table->foreign('airfare_code')
        ->references('code')
        ->on('utility_list_of_values');


    $table->text('properties')->nullable();
    $table->unsignedInteger('created_by')->nullable()->index();
    $table->unsignedInteger('updated_by')->nullable()->index();
    $table->softDeletes();
    $table->timestamps();
});


$projectPlan_menu_id = \Corals\Menu\Models\Menu::query()->where('key', 'ProjectPlan')->first()->id;
\DB::table('menus')->insert([
    [
        'parent_id' => $projectPlan_menu_id,
        'key' => null,
        'url' => config('projectPlan.models.hotel.resource_url'),
        'active_menu_url' => config('projectPlan.models.hotel.resource_url') . '*',
        'name' => 'Hotels',
        'description' => 'Hotels List',
        'icon' => 'fa fa-cube',
        'target' => null,
        'roles' => '["1","4"]',
        'order' => 0
    ],
]);


ListOfValue::query()->insert([
    [
        'code' => 'airfare-types',
        'value' => 'Airfare Types',
        'label' => 'Airfare Types',
        'parent_id' => null,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'travel-types',
        'value' => 'Travel Types',
        'label' => 'Travel Types',
        'parent_id' => null,
        'properties' => null,
        'module' => 'ProjectPlan',
    ]
]);

$travelTypesParent = ListOfValue::query()->where('code', 'travel-types')->first()->id;

$airfareTypesParent = ListOfValue::query()->where('code', 'airfare-types')->first()->id;

ListOfValue::query()->insert([
    [
        'code' => 'lodging',
        'value' => 'Lodging',
        'label' => 'Lodging',
        'parent_id' => $travelTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'airfare',
        'value' => 'Airfare',
        'label' => 'Airfare',
        'parent_id' => $travelTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],

    [
        'code' => 'delta-airlines',
        'value' => 'Delta Airlines',
        'label' => 'Delta Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'american-airlines',
        'value' => 'American Airlines',
        'label' => 'American Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'united-airlines',
        'value' => 'United Airlines',
        'label' => 'United Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'southwest-airlines',
        'value' => 'Southwest Airlines',
        'label' => 'Southwest Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'jetblue-airlines',
        'value' => 'JetBlue Airlines',
        'label' => 'JetBlue Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'frontier-airlines',
        'value' => 'Frontier Airlines',
        'label' => 'Frontier Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'spirit-airlines',
        'value' => 'Spirit Airlines',
        'label' => 'Spirit Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ],
    [
        'code' => 'allegiant-airlines',
        'value' => 'Allegiant Airlines',
        'label' => 'Allegiant Airlines',
        'parent_id' => $airfareTypesParent,
        'properties' => null,
        'module' => 'ProjectPlan',
    ]
]);

Spamworldpro Mini