customer migrations and models

This commit is contained in:
prashant-webkul 2018-07-20 20:45:21 +05:30
parent e4581fc725
commit 072990f6ed
6 changed files with 114 additions and 1 deletions

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers');
}
}

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomersGroupTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers_group', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers_group');
}
}

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomersAddressTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers_address', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers_address');
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace Webkul\Customer\Models;
use Illuminate\Database\Eloquent\Model;
class CustomersGroups extends Model
{
protected $table = 'customers_group';
}

View File

@ -0,0 +1,9 @@
<?php
namespace Webkul\Customer\Models;
use Illuminate\Database\Eloquent\Model;
class CustomersAddress extends Model
{
protected $table = 'customers_address';
}

View File

@ -4,6 +4,8 @@ namespace Webkul\Customer\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Blade;
use Webkul\Admin\Providers\EventServiceProvider;
@ -11,7 +13,7 @@ use Webkul\Admin\Providers\EventServiceProvider;
class CustomerServiceProvider extends ServiceProvider
{
public function boot()
public function boot(Router $router)
{
include __DIR__ . '/../Http/routes.php';