Skip to content

Commit b6e81dc

Browse files
authored
Merge pull request #76 from avored/dev
Dev
2 parents 747c226 + 6200e80 commit b6e81dc

19 files changed

Lines changed: 37 additions & 48 deletions

File tree

.coveralls.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
service_name: travis-pro
2+
repo_token: iq6DvLKbtCBGIL6vstOeIGdCKwdezgKSc

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ php:
66
- '7.2'
77
script:
88
- vendor/bin/phpunit -c phpunit.xml
9+
- vendor/bin/phpunit --coverage-clover=coverage.xml
910

10-
install: composer install --no-interaction
11+
install: composer install --no-interaction

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AvoRed E commerce Framework
1+
# AvoRed a modular Shopping cart framework for a laravel php framework
22
AvoRed Framework contains the core features for the AvoRed E commerce for Laravel. It is the base behind the AvoRed an Laravel Ecommerce.
33

44
#### Installation

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"laravel/framework" : "5.8.*"
2727
},
2828
"require-dev" : {
29-
"phpunit/phpunit" : "~8.1",
29+
"phpunit/phpunit": "^7.5",
3030
"orchestra/testbench" : "~3.7",
3131
"mockery/mockery" : "1.2.*"
3232
},

src/Cart/Manager.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public function add(string $slug, $qty = 1)
6262
$this->cartCollection->put($slug, $cartProduct);
6363
$this->updateSessionCollection();
6464
}
65-
return true;
6665
}
6766

6867
/**
@@ -155,7 +154,7 @@ public function toArray()
155154

156155
/**
157156
* Get the List of All the Current Session Cart Products.
158-
* @return float $cartTotal
157+
* @return mixed $cartTotal
159158
*/
160159
public function total($format = true)
161160
{

src/Catalog/Controllers/ProductController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function saveProductProperty($product, $request)
203203
* Upload Product Images
204204
* @param \AvoRed\Framework\Catalog\Requests\ProductImageRequest $request
205205
* @param \AvoRed\Framework\Database\Models\Product $product
206-
* @return json
206+
* @return \Illuminate\Http\JsonResponse
207207
*/
208208
public function upload(ProductImageRequest $request, Product $product)
209209
{
@@ -218,13 +218,13 @@ public function upload(ProductImageRequest $request, Product $product)
218218
} else {
219219
$imageModel = $product->images()->create(['path' => $dbPath]);
220220
}
221-
return ['image' => $imageModel];
221+
return response()->json(['image' => $imageModel]);
222222
}
223223

224224
/**
225225
* Destroy Product Images
226226
* @param \AvoRed\Framework\Database\Models\ProductImage $productImage
227-
* @return json
227+
* @return \Illuminate\Http\JsonResponse
228228
*/
229229
public function destroyImage(ProductImage $productImage)
230230
{
@@ -233,7 +233,7 @@ public function destroyImage(ProductImage $productImage)
233233
File::delete($filePath);
234234
}
235235
$productImage->delete();
236-
return ['success' => true];
236+
return response()->json(['success' => true]);
237237
}
238238

239239
/**

src/Cms/Controllers/MenuController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class MenuController
2222

2323
/**
2424
* Construct for the AvoRed install command
25-
* @param \AvoRed\Framework\Database\Repository\MenuRepository $menuRepository
25+
* @param \AvoRed\Framework\Database\Contracts\MenuModelInterface $menuRepository
26+
* @param \AvoRed\Framework\Database\Contracts\CategoryModelInterface $categoryRepository
2627
*/
2728
public function __construct(
2829
MenuModelInterface $menuRepository,
@@ -39,7 +40,6 @@ public function __construct(
3940
public function index()
4041
{
4142
$categories = $this->categoryRepository->all();
42-
//$categories = $this->setCategoriesUrl();
4343

4444
return view('avored::cms.menu.create')
4545
->with('categories', $categories);
@@ -78,9 +78,9 @@ public function store(MenuRequest $request)
7878
*/
7979
public function setCategoriesUrl($categories)
8080
{
81-
81+
//@todo
8282
foreach ($categories as $category) {
83-
$url = route();
83+
$url = route('admin.category');
8484
$category->url = $url;
8585
}
8686

src/Cms/Requests/MenuRequest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ public function authorize()
2323
*/
2424
public function rules()
2525
{
26-
$validationRule = [];
27-
$validationRule['name'] = 'required|max:255';
28-
if (null === $this->request->get('menu_group_id')) {
29-
$validationRule['identifier'] = 'required|unique:menu_groups';
30-
}
31-
return $validationRule;
26+
$rules = [];
27+
28+
return $rules;
3229
}
3330
}

src/Database/Models/AdminUser.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
namespace AvoRed\Framework\Database\Models;
44

5-
use Illuminate\Notifications\Notifiable;
65
use AvoRed\Framework\User\Notifications\ResetPassword;
76
use Illuminate\Foundation\Auth\User as Authenticatable;
8-
use Laravel\Passport\ClientRepository;
97

108
class AdminUser extends Authenticatable
119
{
12-
use Notifiable;
1310
/**
1411
* The attributes that are mass assignable.
1512
*
@@ -82,23 +79,6 @@ public function setPasrdAttribute($val)
8279
$this->attributes['password'] = bcrypt($val);
8380
}
8481

85-
/**
86-
* Get the Passport Client for User and If it doesnot exist then create a new one
87-
* @return \Laravel\Passport\Client $client
88-
*/
89-
public function getPassportClient()
90-
{
91-
$client = $this->clients->first();
92-
if (null === $client) {
93-
$clientRepository = app(ClientRepository::class);
94-
95-
$redirectUri = route('home'); // Setup Env Variable for Graphql Admin
96-
$client = $clientRepository->createPasswordGrantClient($this->id, $this->name, $redirectUri);
97-
}
98-
99-
return $client;
100-
}
101-
10282
/**
10383
* To check if user has permission to access the given route name
10484
* @return bool

src/Database/Models/ProductImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ProductImage extends Model
1919

2020
/**
2121
* Belongs to Many Product
22-
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
22+
* @return \Illuminate\Database\Eloquent\Relations\HasOne
2323
*/
2424
public function product()
2525
{

0 commit comments

Comments
 (0)