Skip to content

Commit

Permalink
Merge pull request #95 from avored/dev
Browse files Browse the repository at this point in the history
dev to master
  • Loading branch information
indpurvesh authored Sep 11, 2019
2 parents ec8149b + 6d72d25 commit ab69762
Show file tree
Hide file tree
Showing 256 changed files with 2,383 additions and 1,582 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
composer.lock
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: laravel
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<p align="center">
<a href="https://www.avored.com/" target="_blank"><img src="logo.svg" height="86" alt="AvoRed"></a>
</p>

<p align="center">
<a href="https://circleci.com/gh/avored/framework/tree/master"><img src="https://circleci.com/gh/avored/framework/tree/master.svg?style=shield" alt="CircleCI"></a>
<a href="https://packagist.org/packages/avored/framework"><img src="https://poser.pugx.org/avored/framework/downloads" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/avored/framework"><img src="https://poser.pugx.org/avored/framework/v/stable" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/avored/framework"><img src="https://poser.pugx.org/avored/framework/license" alt="License"></a>
</p>


# Core package for avored shopping cart
AvoRed Framework contains the core features for the AvoRed E commerce for Laravel. It is the base behind the AvoRed an Laravel Ecommerce.

Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@
"Cart" : "AvoRed\\Framework\\Support\\Facades\\Cart",
"Menu" : "AvoRed\\Framework\\Support\\Facades\\Menu",
"Module" : "AvoRed\\Framework\\Support\\Facades\\Module",
"Permission" : "AvoRed\\Framework\\Support\\Facades\\Permission",
"Payment" : "AvoRed\\Framework\\Support\\Facades\\Payment",
"Shipping" : "AvoRed\\Framework\\Support\\Facades\\Shipping"
"Permission" : "AvoRed\\Framework\\Support\\Facades\\Permission",
"Shipping" : "AvoRed\\Framework\\Support\\Facades\\Shipping",
"Tab" : "AvoRed\\Framework\\Support\\Facades\\Tab",
"Widget" : "AvoRed\\Framework\\Support\\Facades\\Widget"
}
}
},
Expand Down
12 changes: 6 additions & 6 deletions config/avored.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
'symlink_storage_folder' => 'storage',
'cart' => ['session_key' => 'cart_products'],
'model' => [
'user' => App\User::class
'user' => App\User::class,
],

'filesystems' => [
'disks' => [
'avored' => [
Expand All @@ -33,22 +33,22 @@
'admin' => [
'driver' => 'session',
'provider' => 'admin-users',
]
],
],

'providers' => [
'admin-users' => [
'driver' => 'eloquent',
'model' => AvoRed\Framework\Database\Models\AdminUser::class,
],
],

'passwords' => [
'adminusers' => [
'provider' => 'admin-users',
'table' => 'admin_password_resets',
'expire' => 60,
],
],
]
],
];
4 changes: 2 additions & 2 deletions database/factories/AdminUserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
use AvoRed\Framework\Database\Models\AdminUser;

$factory->define(AdminUser::class, function (Faker $faker) {

$role = factory(Role::class)->create();

return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'email' => $faker->email,
'password' => 'secret',
'role_id' => $role->id,
'is_super_admin' => rand(0, 1),
'image_path' => null
'image_path' => null,
];
});
5 changes: 3 additions & 2 deletions database/factories/AttributeFactory.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

use Illuminate\Support\Str;
use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Attribute;
use Illuminate\Support\Str;

$factory->define(Attribute::class, function (Faker $faker) {
$name = $faker->sentence;

return [
'name' => $name,
'slug' => Str::slug($name),
Expand Down
2 changes: 2 additions & 0 deletions database/factories/CategoryFactory.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Category;

$factory->define(Category::class, function (Faker $faker) {
$name = $faker->word;

return [
'name' => $name,
'slug' => Str::slug($name),
Expand Down
1 change: 1 addition & 0 deletions database/factories/CountryFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Country;

Expand Down
3 changes: 2 additions & 1 deletion database/factories/CurrencyFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Currency;

Expand All @@ -8,6 +9,6 @@
'code' => $faker->currencyCode,
'symbol' => '$',
'conversation_rate' => $faker->randomFloat,
'status' => 'ENABLED'
'status' => 'ENABLED',
];
});
3 changes: 2 additions & 1 deletion database/factories/LanguageFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Language;

$factory->define(Language::class, function (Faker $faker) {
return [
'name' => $faker->word,
'code' => $faker->languageCode
'code' => $faker->languageCode,
];
});
3 changes: 2 additions & 1 deletion database/factories/OrderStatusFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\OrderStatus;

$factory->define(OrderStatus::class, function (Faker $faker) {
return [
'name' => $faker->sentence,
'is_default' => rand(0, 1)
'is_default' => rand(0, 1),
];
});
6 changes: 4 additions & 2 deletions database/factories/PageFactory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?php

use Illuminate\Support\Str;
use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Page;
use Illuminate\Support\Str;

$factory->define(Page::class, function (Faker $faker) {
$name = $faker->word;
$slug = Str::slug($name);

return [
'name' => $name,
'slug' => $slug,
'content' => $faker->text(rand(50, 60))
'content' => $faker->text(rand(50, 60)),
];
});
3 changes: 2 additions & 1 deletion database/factories/PermissionFactory.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Permission;

$factory->define(Permission::class, function (Faker $faker) {
return [
'name' => $faker->word
'name' => $faker->word,
];
});
5 changes: 3 additions & 2 deletions database/factories/PropertyFactory.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

use Illuminate\Support\Str;
use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Property;
use Illuminate\Support\Str;

$factory->define(Property::class, function (Faker $faker) {
$name = $faker->sentence;

return [
'name' => $name,
'slug' => Str::slug($name),
Expand Down
3 changes: 2 additions & 1 deletion database/factories/RoleFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Role;

$factory->define(Role::class, function (Faker $faker) {
return [
'name' => $faker->word,
'description' => $faker->text(rand(50, 60))
'description' => $faker->text(rand(50, 60)),
];
});
1 change: 1 addition & 0 deletions database/factories/StateFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\State;

Expand Down
3 changes: 2 additions & 1 deletion database/factories/TaxGroupFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\TaxGroup;

$factory->define(TaxGroup::class, function (Faker $faker) {
return [
'name' => $faker->word,
'description' => $faker->sentence
'description' => $faker->sentence,
];
});
3 changes: 2 additions & 1 deletion database/factories/TaxRateFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\TaxRate;

Expand All @@ -8,6 +9,6 @@
'description' => $faker->sentence,
'postcode' => $faker->postcode,
'rate' => $faker->randomFloat(2, 0, 2),
'rate_type' => 'PERCENTAGE'
'rate_type' => 'PERCENTAGE',
];
});
3 changes: 2 additions & 1 deletion database/factories/UserGroupFactory.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\UserGroup;

$factory->define(UserGroup::class, function (Faker $faker) {
return [
'name' => $faker->word,
'is_default' => rand(0, 1)
'is_default' => rand(0, 1),
];
});
21 changes: 10 additions & 11 deletions database/migrations/2017_03_29_000000_avored_framework_schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use AvoRed\Framework\Database\Models\Country;
use Illuminate\Database\Migrations\Migration;

class AvoredFrameworkSchema extends Migration
{
Expand Down Expand Up @@ -86,7 +86,7 @@ public function up()
$table->bigInteger('permission_id')->unsigned();
$table->bigInteger('role_id')->unsigned();
$table->timestamps();

$table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
});
Expand Down Expand Up @@ -229,7 +229,7 @@ public function up()
$table->enum('rate_type', ['PERCENTAGE', 'FIXED'])->default('PERCENTAGE');
$table->timestamps();
});

Schema::create('menu_groups', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->nullable()->default(null);
Expand Down Expand Up @@ -292,7 +292,7 @@ public function up()
$table->foreign('product_id')
->references('id')->on('products')->onDelete('cascade');
});

Schema::create('product_property_varchar_values', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('property_id');
Expand Down Expand Up @@ -387,7 +387,7 @@ public function up()
//$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
});

Schema::create('orders', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('shipping_option');
Expand All @@ -399,13 +399,13 @@ public function up()
$table->unsignedBigInteger('billing_address_id')->nullable();
$table->string('track_code')->nullable()->default(null);
$table->timestamps();

$table->foreign('currency_id')->references('id')->on('currencies');
$table->foreign('shipping_address_id')->references('id')->on('addresses');
$table->foreign('billing_address_id')->references('id')->on('addresses');
$table->foreign('order_status_id')->references('id')->on('order_statuses');
});

Schema::create('order_products', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('product_id');
Expand Down Expand Up @@ -464,7 +464,7 @@ public function up()
$table->timestamps();
});

$path = __DIR__ . '/../../assets/countries.json';
$path = __DIR__.'/../../assets/countries.json';
$json = json_decode(file_get_contents($path), true);
foreach ($json as $country) {
Country::create([
Expand All @@ -487,7 +487,6 @@ public function down()
{
Schema::disableForeignKeyConstraints();


Schema::dropIfExists('attribute_product');
Schema::dropIfExists('attribute_product_values');
Schema::dropIfExists('product_variations');
Expand Down Expand Up @@ -526,14 +525,14 @@ public function down()

Schema::dropIfExists('category_translations');
Schema::dropIfExists('categories');

Schema::dropIfExists('admin_users');
Schema::dropIfExists('admin_password_resets');

Schema::dropIfExists('roles');

Schema::dropIfExists('languages');

Schema::enableForeignKeyConstraints();
}
}
1 change: 1 addition & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ab69762

Please sign in to comment.