Merge branch 'master' of https://github.com/bagisto/bagisto into prashant

This commit is contained in:
prashant-webkul 2018-11-26 10:27:07 +05:30
commit f93716a801
12 changed files with 160 additions and 123 deletions

View File

@ -1,13 +1,16 @@
![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png)
                       ![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png)
1. #### Introduction
2. #### Requirements
3. #### Installation
4. #### Configuration
# Topics
1. ### Introduction
2. ### Requirements
3. ### Installation
4. ### Configuration
5. ### Migration Guides
6. ### License
# 1. About Bagisto:
### 1. Introduction:
[Bagisto](https://www.bagisto.com) is a hand tailored E-Commerce framework designed on some of the hottest opensource technologies
such as [Laravel](https://laravel.com) a [PHP](https://secure.php.net/) framework, [Vue.js](https://vuejs.org)
@ -16,6 +19,8 @@ a [Node.js](https://nodejs.org) framework.
**Bagisto is viable attempt to cut down your time, cost and workforce for building online stores or migrating from physical stores
to the ever demanding online world. Your business whether small or huge it suits all and very simple to set it up.**
**We are also having a forum for any type of your concern, feature request discussions. Please visit: [Bagisto Forums](https://forums.bagisto.com/)**
It packs in lots of demanding features that allows your business to scale in no time:
* Multiple Channels, Locale, Currencies.
@ -30,14 +35,13 @@ It packs in lots of demanding features that allows your business to scale in no
* Orders Management System.
* Customer Cart, Wishlist, Product Reviews.
* Simple and Configurable Products.
* check out [more....](https://bagisto.com/features/).
* Check out [more....](https://bagisto.com/features/).
**For Developers**:
Dev guys can take advantage of two of the hottest frameworks used in this project Laravel and Vue.js, both of these frameworks have been used in Bagisto.
Bagisto is using power of both of these frameworks and making best out of it out of the box.
# 2. Requirements:
### 2. Requirements:
* **OS**: Ubuntu 16.04 LTS or higher.
* **SERVER**: Apache 2 or NGINX
@ -48,7 +52,7 @@ Bagisto is using power of both of these frameworks and making best out of it out
* **Node**: 8.11.3 LTS or higher.
* **Composer**: 1.6.5 or higher.
# 3. Configuration:
### 3. Configuration:
**Run this Command** to download the project on to your local machine or server:
~~~
@ -70,7 +74,7 @@ Although you have to set the mailer variables also for full functioning of your
default.
# 4.Installation:
### 4. Installation:
**1. Run the Command**
~~~
@ -97,6 +101,17 @@ php artisan storage:link
> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory.
### 5. Migration from v0.1.0 to v0.1.1
# License
**Run commands below:**
> **php artisan migrate**
> **php artisan vendor:publish**
### 6. License
Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://opensource.org/licenses/MIT).
### Coming Soon:
-> API support for core and numerous fixes.

View File

@ -1,25 +0,0 @@
<div class="control-group">
<label for="country">{{ __('admin::app.common.country') }}</label>
<select class="control" id="country" name="country">
@foreach(core()->countries() as $country)
<option value="{{ $country->code }}" {{ old('country') == $country->code ? 'selected' : '' }}>
{{ $country->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<label for="state">{{ __('admin::app.common.state') }}</label>
<input class="control" id="state" name="state" value="{{ old('state') }}"/>
</div>
@push('scripts')
@endpush

View File

@ -1,28 +0,0 @@
<div class="control-group">
<?php $selectedCountry = old('country') ?: $model->country ?>
<label for="country">{{ __('admin::app.common.country') }}</label>
<select class="control" id="country" name="country">
@foreach(core()->countries() as $country)
<option value="{{ $country->code }}" {{ $selectedCountry == $country->code ? 'selected' : '' }}>
{{ $country->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<label for="state">{{ __('admin::app.common.state') }}</label>
<input class="control" id="state" name="state" value="{{ old('state') ?: $model->state }}"/>
</div>
@push('scripts')
@endpush

View File

@ -74,24 +74,27 @@
<accordian :title="'{{ __('admin::app.settings.inventory_sources.contact-info') }}'" :active="true">
<div slot="body">
<div class="control-group">
<label for="contact_name">{{ __('admin::app.settings.inventory_sources.contact_name') }}</label>
<input class="control" id="contact_name" name="contact_name" value="{{ old('contact_name') }}"/>
<div class="control-group" :class="[errors.has('contact_name') ? 'has-error' : '']">
<label for="contact_name" class="required">{{ __('admin::app.settings.inventory_sources.contact_name') }}</label>
<input class="control" v-validate="'required'" class="required" id="contact_name" name="contact_name" value="{{ old('contact_name') }}"/>
<span class="control-error" v-if="errors.has('contact_name')">@{{ errors.first('contact_name') }}</span>
</div>
<div class="control-group">
<label for="contact_email">{{ __('admin::app.settings.inventory_sources.contact_email') }}</label>
<input class="control" id="contact_email" name="contact_email" value="{{ old('contact_email') }}"/>
<div class="control-group" :class="[errors.has('contact_email') ? 'has-error' : '']">
<label for="contact_email" class="required">{{ __('admin::app.settings.inventory_sources.contact_email') }}</label>
<input class="control" v-validate="'required'" class="required" id="contact_email" name="contact_email" value="{{ old('contact_email') }}"/>
<span class="control-error" v-if="errors.has('contact_email')">@{{ errors.first('contact_email') }}</span>
</div>
<div class="control-group">
<label for="contact_number">{{ __('admin::app.settings.inventory_sources.contact_number') }}</label>
<input class="control" id="contact_number" name="contact_number" value="{{ old('contact_number') }}"/>
<div class="control-group" :class="[errors.has('contact_number') ? 'has-error' : '']">
<label for="contact_number" class="required">{{ __('admin::app.settings.inventory_sources.contact_number') }}</label>
<input class="control" v-validate="'required'" class="required" id="contact_number" name="contact_number" value="{{ old('contact_number') }}"/>
<span class="control-error" v-if="errors.has('contact_number')">@{{ errors.first('contact_number') }}</span>
</div>
<div class="control-group">
<label for="contact_fax">{{ __('admin::app.settings.inventory_sources.contact_fax') }}</label>
<input class="control" id="country" name="contact_fax" value="{{ old('contact_fax') }}"/>
<input class="control" class="required" id="country" name="contact_fax" value="{{ old('contact_fax') }}"/>
</div>
</div>
@ -100,26 +103,24 @@
<accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true">
<div slot="body">
@include ('admin::common.create-country-state')
@include ('admin::customers.country-state', ['countryCode' => old('country'), 'stateCode' => old('state')])
<div class="control-group">
<label for="state">{{ __('admin::app.settings.inventory_sources.state') }}</label>
<input class="control" id="state" name="state" value="{{ old('state') }}"/>
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
<label for="city" class="required">{{ __('admin::app.settings.inventory_sources.city') }}</label>
<input v-validate="'required'" class="control" id="city" name="city" value="{{ old('city') }}"/>
<span class="control-error" v-if="errors.has('city')">@{{ errors.first('city') }}</span>
</div>
<div class="control-group">
<label for="city">{{ __('admin::app.settings.inventory_sources.city') }}</label>
<input class="control" id="city" name="city" value="{{ old('city') }}"/>
<div class="control-group" :class="[errors.has('street') ? 'has-error' : '']">
<label for="street" class="required">{{ __('admin::app.settings.inventory_sources.street') }}</label>
<input v-validate="'required'" class="control" id="street" name="street" value="{{ old('street') }}"/>
<span class="control-error" v-if="errors.has('street')">@{{ errors.first('street') }}</span>
</div>
<div class="control-group">
<label for="street">{{ __('admin::app.settings.inventory_sources.street') }}</label>
<input class="control" id="street" name="street" value="{{ old('street') }}"/>
</div>
<div class="control-group">
<label for="postcode">{{ __('admin::app.settings.inventory_sources.postcode') }}</label>
<input class="control" id="postcode" name="postcode" value="{{ old('postcode') }}"/>
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
<label for="postcode" class="required">{{ __('admin::app.settings.inventory_sources.postcode') }}</label>
<input v-validate="'required'" class="control" id="postcode" name="postcode" value="{{ old('postcode') }}"/>
<span class="control-error" v-if="errors.has('postcode')">@{{ errors.first('postcode') }}</span>
</div>
</div>

View File

@ -75,19 +75,22 @@
<accordian :title="'{{ __('admin::app.settings.inventory_sources.contact-info') }}'" :active="true">
<div slot="body">
<div class="control-group">
<label for="contact_name">{{ __('admin::app.settings.inventory_sources.contact_name') }}</label>
<input class="control" id="contact_name" name="contact_name" value="{{ old('contact_name') ?: $inventorySource->contact_name }}"/>
<div class="control-group" :class="[errors.has('contact_name') ? 'has-error' : '']">
<label for="contact_name" class="required">{{ __('admin::app.settings.inventory_sources.contact_name') }}</label>
<input class="control" v-validate="'required'" id="contact_name" name="contact_name" value="{{ old('contact_name') ?: $inventorySource->contact_name }}"/>
<span class="control-error" v-if="errors.has('contact_name')">@{{ errors.first('contact_name') }}</span>
</div>
<div class="control-group">
<label for="contact_email">{{ __('admin::app.settings.inventory_sources.contact_email') }}</label>
<input class="control" id="contact_email" name="contact_email" value="{{ old('contact_email') ?: $inventorySource->symbol }}"/>
<div class="control-group" :class="[errors.has('contact_email') ? 'has-error' : '']">
<label for="contact_email" class="required">{{ __('admin::app.settings.inventory_sources.contact_email') }}</label>
<input class="control" v-validate="'required'" id="contact_email" name="contact_email" value="{{ old('contact_email') ?: $inventorySource->symbol }}"/>
<span class="control-error" v-if="errors.has('contact_email')">@{{ errors.first('contact_email') }}</span>
</div>
<div class="control-group">
<label for="contact_number">{{ __('admin::app.settings.inventory_sources.contact_number') }}</label>
<input class="control" id="contact_number" name="contact_number" value="{{ old('contact_number') ?: $inventorySource->contact_number }}"/>
<div class="control-group" :class="[errors.has('contact_number') ? 'has-error' : '']">
<label for="contact_number" class="required">{{ __('admin::app.settings.inventory_sources.contact_number') }}</label>
<input class="control" v-validate="'required'" id="contact_number" name="contact_number" value="{{ old('contact_number') ?: $inventorySource->contact_number }}"/>
<span class="control-error" v-if="errors.has('contact_number')">@{{ errors.first('contact_number') }}</span>
</div>
<div class="control-group">
@ -101,21 +104,24 @@
<accordian :title="'{{ __('admin::app.settings.inventory_sources.address') }}'" :active="true">
<div slot="body">
@include ('admin::common.edit-country-state', ['model' => $inventorySource])
@include ('admin::customers.country-state', ['countryCode' => old('country') ?? $inventorySource->country, 'stateCode' => old('state') ?? $inventorySource->state])
<div class="control-group">
<label for="city">{{ __('admin::app.settings.inventory_sources.city') }}</label>
<input class="control" id="city" name="city" value="{{ old('city') ?: $inventorySource->city }}"/>
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
<label for="city" class="required">{{ __('admin::app.settings.inventory_sources.city') }}</label>
<input class="control" v-validate="'required'" id="city" name="city" value="{{ old('city') ?: $inventorySource->city }}"/>
<span class="control-error" v-if="errors.has('city')">@{{ errors.first('city') }}</span>
</div>
<div class="control-group">
<label for="street">{{ __('admin::app.settings.inventory_sources.street') }}</label>
<input class="control" id="street" name="street" value="{{ old('street') ?: $inventorySource->street }}"/>
<div class="control-group" :class="[errors.has('street') ? 'has-error' : '']">
<label for="street" class="required">{{ __('admin::app.settings.inventory_sources.street') }}</label>
<input class="control" v-validate="'required'" id="street" name="street" value="{{ old('street') ?: $inventorySource->street }}"/>
<span class="control-error" v-if="errors.has('street')">@{{ errors.first('street') }}</span>
</div>
<div class="control-group">
<label for="postcode">{{ __('admin::app.settings.inventory_sources.postcode') }}</label>
<input class="control" id="postcode" name="postcode" value="{{ old('postcode') ?: $inventorySource->postcode }}"/>
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
<label for="postcode" class="required">{{ __('admin::app.settings.inventory_sources.postcode') }}</label>
<input class="control" v-validate="'required'" id="postcode" name="postcode" value="{{ old('postcode') ?: $inventorySource->postcode }}"/>
<span class="control-error" v-if="errors.has('postcode')">@{{ errors.first('postcode') }}</span>
</div>
</div>

View File

@ -738,7 +738,8 @@ class Cart {
*
* @return boolean
*/
public function validateItems() {
public function validateItems()
{
$cart = $this->getCart();
//rare case of accident-->used when there are no items.

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCartItemInventoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cart_item_inventories', function (Blueprint $table) {
$table->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');
}
}

View File

@ -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();

View File

@ -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',
]);
}
}

View File

@ -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);

View File

@ -60,6 +60,8 @@ class AccountController extends Controller
if(!$data['password'])
unset($data['password']);
else
$data['password'] = bcrypt($data['password']);
$user->update($data);

View File

@ -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);