Skip to content

Commit

Permalink
Merge pull request #496 from avored/developed
Browse files Browse the repository at this point in the history
Developed
  • Loading branch information
indpurvesh authored Oct 7, 2020
2 parents 409bb08 + a8e922e commit 0983c20
Show file tree
Hide file tree
Showing 73 changed files with 90,533 additions and 48,138 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#### **Bug Reporting**
* **Ensure the bug was not already reported** by searching on GitHub under [Issues.](https://github.com/avored/laravel-ecommerce/issues)
* If you're unable to find an open issue that relates to your problem, [open a new one.](https://github.com/avored/laravel-ecommerce/issues/new) Please be sure to follow the issue template as much as possible.
* **Ensure that the bug you are reporting is a Avored issue** and not specific to your individual setup. For these types of issues please use the [Community Forum.](https://www.avored.com/discussion)
* **Ensure that the bug you are reporting is a Avored issue** and not specific to your individual setup. For these types of issues please use the [Community Forum.](https://avored.com/discussion)

#### **Did you fix a bug?**

Expand Down Expand Up @@ -65,4 +65,4 @@
| In Review | Currently in-review and requires additional work from creator. |
| Needs Tests | Pull requests that require unit tests before they can be merged. |
| Ready to Merge | Pull requests that have both been assessed and code reviewed. |
| Wrong Branch | Pull requests that have been created to the wrong branch. |
| Wrong Branch | Pull requests that have been created to the wrong branch. |
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ about: Create a report to help us improve
---

**Ideally we would expect you to raise a bug on AvoRed Official Website **
https://www.avored.com/discussion/category/general
https://avored.com/discussion/category/general

**Describe the bug**
A clear and concise description of what the bug is.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ about: If you want to discuss about any topic.
---

**Ideally we would expect you to raise a discussion on AvoRed Official Website **
https://www.avored.com/discussion/category/general
https://avored.com/discussion/category/general
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ about: Suggest an idea for this project
---

**Ideally we would expect you to raise a feature request on AvoRed Official Website **
https://www.avored.com/discussion/category/feature
https://avored.com/discussion/category/feature

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/vendor
/modules/avored/stripe
/modules/avored/pos
/modules/avored/heroproduct
.env
.env.dusk.local
.phpunit.result.cache
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://www.avored.com/" target="_blank"><img src="./public/images/logo.svg?sanitize=true" height="86" alt="AvoRed"></a>
<a href="https://avored.com/" target="_blank"><img src="./public/images/logo.svg?sanitize=true" height="86" alt="AvoRed"></a>
</p>

<p align="center">
Expand All @@ -9,21 +9,21 @@
<a href="https://packagist.org/packages/avored/framework" target="_blank"><img src="https://poser.pugx.org/avored/framework/license" alt="License"></a>
</p>

#### [AvoRed](https://www.avored.com/) is commin up as a headless graphql version.
#### [AvoRed](https://avored.com/) is commin up as a headless graphql version.

[AvoRed](https://www.avored.com/) is a free open-source e-commerce platform written in PHP based on Laravel.
[AvoRed](https://avored.com/) is a free open-source e-commerce platform written in PHP based on Laravel.
Its an ingenuous and modular e-commerce that is easily customizable according to your needs, with a modern responsive mobile friendly interface as default.
The main advantage of being an modular E-Commerce is that you can download each module separately that is necessary for your store.

[![Chat on Slack](https://img.shields.io/badge/join--slack-avored--ecommerce-c62828.svg?longCache=true&style=for-the-badge&logo=slack&color=#c62828)](https://join.slack.com/t/avored/shared_invite/zt-5osaf044-nuTeldrwVsa~xI0XyVlZjQ)

## Changelog

All notable changes to [AvoRed](https://www.avored.com/) will be documented [here](CHANGELOG.md).
All notable changes to [AvoRed](https://avored.com/) will be documented [here](CHANGELOG.md).

## Documentation

Please visit the [AvoRed Documentation](https://www.avored.com/docs) to get started with [AvoRed](https://www.avored.com/).
Please visit the [AvoRed Documentation](https://avored.com/docs) to get started with [AvoRed](https://avored.com/).

## Demo

Expand All @@ -35,11 +35,11 @@ Please read our [contributing guide](.github/CONTRIBUTING.md) if you want to con

## Contributors

[AvoRed](https://www.avored.com/) exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
[AvoRed](https://avored.com/) exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
<a href="https://github.com/avored/laravel-ecommerce/graphs/contributors"><img src="https://opencollective.com/laravel-ecommerce/contributors.svg?width=890" title="contributors" alt="contributors" /></a>

## Sponsors

Support [AvoRed](https://www.avored.com/) by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/laravel-ecommerce#sponsor)]
Support [AvoRed](https://avored.com/) by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/laravel-ecommerce#sponsor)]

<a href="https://opencollective.com/laravel-ecommerce/sponsor/0/website" target="_blank"><img src="https://opencollective.com/laravel-ecommerce/sponsor/0/avatar.svg"></a>
14 changes: 14 additions & 0 deletions app/Http/Composers/NavComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\View\View;
use Illuminate\Support\Facades\Auth;
use AvoRed\Framework\Database\Contracts\MenuGroupModelInterface;
use AvoRed\Framework\Database\Models\Menu;

class NavComposer
{
Expand Down Expand Up @@ -34,6 +35,19 @@ public function compose(View $view)
$menus = $this->menuGroupRepository->getTreeByIdentifier('main-menu');
}

foreach ($menus as $menu) {
switch ($menu->type) {
case Menu::CATEGORY :
$menu->url = route('category.show', $menu->route_info);
break;
case Menu::FRONT_MENU :
$menu->url = route($menu->route_info);
break;
case Menu::FRONT_MENU :
$menu->url = url($menu->route_info);
break;
}
}
$view->with(compact('menus'));
}
}
3 changes: 2 additions & 1 deletion app/Http/Controllers/Account/AddressController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public function store(AddressRequest $request)
*/
public function show($id)
{
//
//Show address information about address
var_dump($id);
}

/**
Expand Down
9 changes: 8 additions & 1 deletion app/Http/Controllers/Account/SaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Http\Requests\Account\SaveRequest;
use Illuminate\Support\Facades\Auth;


class SaveController extends Controller
{
/**
Expand All @@ -16,7 +17,13 @@ public function __invoke(SaveRequest $request)
{
/** @var \AvoRed\Framework\Database\Models\Customer $customer */
$customer = Auth::guard('customer')->user();
$customer->update($request->all());
//$customer->update($request->all());

$customer->update([
'first_name' => $request->input('first_name'),
'last_name' => $request->input('last_name'),
//'password' => Hash::make($request->password)
]);

return redirect()->route('account.dashboard');
}
Expand Down
19 changes: 19 additions & 0 deletions app/Http/Controllers/Account/UpdatePasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Http\Controllers\Account;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Requests\Account\UpdatePasswordRequest;
use Illuminate\Support\Facades\Hash;

class UpdatePasswordController extends Controller
{
public function __invoke(UpdatePasswordRequest $request)
{
$request->user()->update([
'password' => Hash::make($request->password)
]);
return redirect()->route('account.dashboard');
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Cart;

use Illuminate\Http\Request;
use App\Http\Requests\CartRequest;
use AvoRed\Framework\Support\Facades\Cart;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Arr;
use App\Http\Controllers\Controller;

class CartController extends Controller
{
Expand Down Expand Up @@ -41,6 +42,7 @@ public function addToCart(CartRequest $request)
public function show(Request $request)
{
$cartProducts = Cart::all();
//var_dump($cartProducts);

return view('cart.show')->with(compact('cartProducts'));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Category;

use Illuminate\Http\Request;
use AvoRed\Framework\Database\Contracts\CategoryModelInterface;
use AvoRed\Framework\Database\Contracts\CategoryFilterModelInterface;
use AvoRed\Wishlist\Database\Contracts\WishlistModelInterface;
use App\Http\Controllers\Controller;

class CategoryController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Checkout;

use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
use AvoRed\Framework\Support\Facades\Payment;
use AvoRed\Framework\Support\Facades\Shipping;
use AvoRed\Framework\Database\Contracts\AddressModelInterface;
use AvoRed\Framework\Database\Contracts\CountryModelInterface;
use App\Http\Controllers\Controller;

class CheckoutController extends Controller
{
Expand Down
7 changes: 4 additions & 3 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use AvoRed\Framework\Database\Contracts\PageModelInterface;
use AvoRed\Framework\Database\Contracts\ProductModelInterface;
use AvoRed\Wishlist\Database\Contracts\WishlistModelInterface;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

class HomeController extends Controller
{
Expand Down Expand Up @@ -46,7 +48,7 @@ public function __construct(
*/
public function index()
{
$wishlists = $this->wishlistRepository->userWishlists();

$page = $this->pageRepository->findBySlug('home-page');
$allProducts = $this->productRepository->getAllWithoutVaiation();
$heroProduct = null;
Expand All @@ -65,7 +67,6 @@ public function index()
return view('home')
->with('heroProduct', $heroProduct)
->with('products', $products)
->with('page', $page)
->with('wishlists', $wishlists);
->with('page', $page);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Order;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
Expand All @@ -14,6 +14,9 @@
use AvoRed\Framework\Database\Contracts\OrderProductModelInterface;
use AvoRed\Framework\Database\Contracts\OrderProductAttributeModelInterface;
use AvoRed\Framework\Support\Facades\Payment;
use App\Http\Controllers\Controller;
use App\Http\Requests\Order\OrderPlaceRequest;
use Illuminate\Support\Facades\Hash;

class OrderController extends Controller
{
Expand Down Expand Up @@ -98,7 +101,7 @@ public function __construct(
* Place the Order .
* @return \Illuminate\Contracts\Support\Renderable
*/
public function place(Request $request)
public function place(OrderPlaceRequest $request)
{
$this->customer($request);
$this->shippingAddress($request);
Expand Down Expand Up @@ -135,11 +138,16 @@ public function customer($request)
$this->customer = Auth::guard('customer')->user();
} else {
$email = $request->get('email');

$this->customer = $this->customerRepository->findByEmail($email);
$this->customer = $this->customerRepository->findByEmail($email);

if ($this->customer === null) {
$this->customer = $this->customerRepository->create($request->all());
$this->customer = $this->customerRepository->create([
'first_name' => $request->input('first_name'),
'last_name' => $request->input('last_name'),
'email' => $request->input('email'),
'password' => Hash::make($request->input('password'))
]);

}
}
Expand All @@ -154,6 +162,7 @@ public function customer($request)
public function shippingAddress($request)
{
$addressData = $request->get('shipping');
//var_dump($addressData);

if (isset($addressData['address_id'])) {
$this->shippingAddress = $this->addressRepository->find($addressData['address_id']);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Product;

use Illuminate\Http\Request;
use AvoRed\Framework\Database\Contracts\ProductModelInterface;
use AvoRed\Review\Database\Contracts\ProductReviewModelInterface;
use App\Http\Controllers\Controller;

class ProductController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Spa;


class SpaController
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Requests/Account/SaveRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Foundation\Http\FormRequest;


class SaveRequest extends FormRequest
{
/**
Expand All @@ -25,7 +26,7 @@ public function rules()
{
return [
'first_name' => 'required|max:255',
'last_name' => 'required|max:255'
'last_name' => 'required|max:255',
];
}
}
32 changes: 32 additions & 0 deletions app/Http/Requests/Account/UpdatePasswordRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Http\Requests\Account;

use Illuminate\Foundation\Http\FormRequest;
use App\Rules\CurrentPassword;

class UpdatePasswordRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}

/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'password_current' => ['required', new CurrentPassword()],
'password' => 'required|string|min:6|confirmed',
];
}
}
Loading

0 comments on commit 0983c20

Please sign in to comment.