-
-
+
+
+
+ @{{ errors.first('street') }}
-
diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php
index f3db9139d..ce1bcb055 100644
--- a/packages/Webkul/Checkout/src/Cart.php
+++ b/packages/Webkul/Checkout/src/Cart.php
@@ -737,7 +737,8 @@ class Cart {
*
* @return boolean
*/
- public function validateItems() {
+ public function validateItems()
+ {
$cart = $this->getCart();
//rare case of accident-->used when there are no items.
diff --git a/packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php
new file mode 100644
index 000000000..f1f9418d9
--- /dev/null
+++ b/packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php
@@ -0,0 +1,34 @@
+increments('id');
+ $table->integer('qty')->default(0);
+ $table->integer('inventory_source_id')->unsigned()->nullable();
+ $table->integer('cart_item_id')->unsigned()->nullable();
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('cart_item_inventories');
+ }
+}
diff --git a/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php b/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php
index 01f3a947e..8a717dbaa 100644
--- a/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php
+++ b/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php
@@ -18,15 +18,15 @@ class CreateInventorySourcesTable extends Migration
$table->string('code')->unique();
$table->string('name');
$table->text('description')->nullable();
- $table->string('contact_name')->nullable();
- $table->string('contact_email')->nullable();
- $table->string('contact_number')->nullable();
+ $table->string('contact_name');
+ $table->string('contact_email');
+ $table->string('contact_number');
$table->string('contact_fax')->nullable();
- $table->string('country')->nullable();
- $table->string('state')->nullable();
- $table->string('city')->nullable();
- $table->string('street')->nullable();
- $table->string('postcode')->nullable();
+ $table->string('country');
+ $table->string('state');
+ $table->string('city');
+ $table->string('street');
+ $table->string('postcode');
$table->integer('priority')->default(0);
$table->decimal('latitude', 10, 5)->nullable();
$table->decimal('longitude', 10, 5)->nullable();
diff --git a/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php b/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php
index 7ae3ee6f8..e5493fcde 100644
--- a/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php
+++ b/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php
@@ -15,7 +15,15 @@ class InventoryTableSeeder extends Seeder
'id' => 1,
'code' => 'default',
'name' => 'Default',
+ 'contact_name' => 'Detroit Warehouse',
+ 'contact_email' => 'warehouse@example.com',
+ 'contact_number' => 1234567899,
'status' => 1,
+ 'country' => 'US',
+ 'state' => 'MI',
+ 'street' => '12th Street',
+ 'city' => 'Detroit',
+ 'postcode' => '48127',
]);
}
}
\ No newline at end of file
diff --git a/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php b/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php
index be70c4ec0..13bdb4e6b 100644
--- a/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php
+++ b/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php
@@ -69,8 +69,16 @@ class InventorySourceController extends Controller
public function store()
{
$this->validate(request(), [
- 'code' => ['required', 'unique:inventory_sources,code', new \Webkul\Core\Contracts\Validations\Code],
- 'name' => 'required'
+ 'code' => ['required', 'unique:inventory_sources,code', new \Webkul\Core\Contracts\Validations\Code],
+ 'name' => 'required',
+ 'contact_name' => 'required',
+ 'contact_email' => 'required',
+ 'contact_number' => 'required',
+ 'street' => 'required',
+ 'country' => 'required',
+ 'state' => 'required',
+ 'city' => 'required',
+ 'postcode' => 'required'
]);
$this->inventorySource->create(request()->all());
@@ -103,8 +111,16 @@ class InventorySourceController extends Controller
public function update(Request $request, $id)
{
$this->validate(request(), [
- 'code' => ['required', 'unique:inventory_sources,code,' . $id, new \Webkul\Core\Contracts\Validations\Code],
- 'name' => 'required',
+ 'code' => ['required', 'unique:inventory_sources,code,' . $id, new \Webkul\Core\Contracts\Validations\Code],
+ 'name' => 'required',
+ 'contact_name' => 'required',
+ 'contact_email' => 'required',
+ 'contact_number' => 'required',
+ 'street' => 'required',
+ 'country' => 'required',
+ 'state' => 'required',
+ 'city' => 'required',
+ 'postcode' => 'required'
]);
$this->inventorySource->update(request()->all(), $id);
diff --git a/packages/Webkul/User/src/Http/Controllers/AccountController.php b/packages/Webkul/User/src/Http/Controllers/AccountController.php
index 94b89fde9..0b4750928 100644
--- a/packages/Webkul/User/src/Http/Controllers/AccountController.php
+++ b/packages/Webkul/User/src/Http/Controllers/AccountController.php
@@ -60,6 +60,8 @@ class AccountController extends Controller
if(!$data['password'])
unset($data['password']);
+ else
+ $data['password'] = bcrypt($data['password']);
$user->update($data);
diff --git a/packages/Webkul/User/src/Http/Controllers/UserController.php b/packages/Webkul/User/src/Http/Controllers/UserController.php
index f562b793b..e3e3c6392 100644
--- a/packages/Webkul/User/src/Http/Controllers/UserController.php
+++ b/packages/Webkul/User/src/Http/Controllers/UserController.php
@@ -87,7 +87,12 @@ class UserController extends Controller
*/
public function store(UserForm $request)
{
- $this->admin->create(request()->all());
+ $data = request()->all();
+
+ if(isset($data['password']) && $data['password'])
+ $data['password'] = bcrypt($data['password']);
+
+ $this->admin->create($data);
session()->flash('success', 'User created successfully.');
@@ -122,6 +127,8 @@ class UserController extends Controller
if(!$data['password'])
unset($data['password']);
+ else
+ $data['password'] = bcrypt($data['password']);
$this->admin->update($data, $id);