Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zareismail committed Apr 16, 2020
1 parent 651dfaa commit fc08757
Show file tree
Hide file tree
Showing 21 changed files with 15,918 additions and 0 deletions.
29 changes: 29 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "armincms/facility",
"description": "A Laravel Nova tool.",
"keywords": [
"laravel",
"nova"
],
"license": "MIT",
"require": {
"php": ">=7.1.0",
},
"autoload": {
"psr-4": {
"Armincms\\Facility\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Armincms\\Facility\\ToolServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFacilityFacilitiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facility_facilities', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('resource');
$table->string('field')->default("Armincms\\Facility\\Nova\\Fields\\Boolean");
$table->string('icon')->default('none');
$table->auth();
$table->softDeletes();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('facility_facilities');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFacilityTranslationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facility_translations', function (Blueprint $table) {
$table->bigIncrements('id');
$table->resource('label');
$table->json('options');
$table->string('help')->nullable();
$table->unsignedBigInteger('facility_id');

$table->foreign('facility_id')->references('id')->on('facility_facilities')
->onDelete('cascade')
->onUpdate('cascade');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('facility_translations');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFacilityFacilitateTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facility_facilitate', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('facilitate');
$table->unsignedBigInteger('facility_id');
$table->string("value")->nullable();
$table->integer('order')->default(0);

$table
->foreign('facility_id')->references('id')->on('facility_facilities')
->onDelete('cascade')
->onUpdate('cascade');

$table->index([
'facility_id', 'facilitate_id', 'facilitate_type'
], 'facility_facilitate_primary');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('facility_facilitate');
}
}
Loading

0 comments on commit fc08757

Please sign in to comment.