Skip to content

Commit e43d712

Browse files
authored
Merge pull request #534 from avored/developed
Developed
2 parents 41d7d84 + 134989b commit e43d712

30 files changed

+696
-489
lines changed

app/Http/Controllers/Account/DashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DashboardController extends Controller
1313
*/
1414
public function index()
1515
{
16-
$user = Auth::user();
16+
$user = Auth::guard('customer')->user();
1717
return view('account.dashboard', compact('user'));
1818
}
1919
}

app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Http\Controllers\Controller;
66
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7+
use Illuminate\Http\Request;
78
use Illuminate\Support\Facades\Auth;
89
use Illuminate\Support\Facades\Password;
910

@@ -19,9 +20,7 @@ class ForgotPasswordController extends Controller
1920
| your application to your users. Feel free to explore this trait.
2021
|
2122
*/
22-
23-
use SendsPasswordResetEmails;
24-
23+
2524
/**
2625
* Create a new controller instance.
2726
*
@@ -50,4 +49,72 @@ public function broker()
5049
{
5150
return Password::broker('customers');
5251
}
52+
53+
54+
/**
55+
* Display the form to request a password reset link.
56+
*
57+
* @return \Illuminate\Http\Response
58+
*/
59+
public function showLinkRequestForm()
60+
{
61+
return view('auth.passwords.email');
62+
}
63+
64+
/**
65+
* Get the response for a successful password reset link.
66+
*
67+
* @param \Illuminate\Http\Request $request
68+
* @param string $response
69+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
70+
*/
71+
protected function sendResetLinkResponse(Request $request, $response)
72+
{
73+
return back()->with('status', trans($response));
74+
}
75+
76+
77+
/**
78+
* Get the needed authentication credentials from the request.
79+
*
80+
* @param \Illuminate\Http\Request $request
81+
* @return array
82+
*/
83+
protected function credentials(Request $request)
84+
{
85+
return $request->only('email');
86+
}
87+
/**
88+
* Validate the email for the given request.
89+
*
90+
* @param \Illuminate\Http\Request $request
91+
* @return void
92+
*/
93+
protected function validateEmail(Request $request)
94+
{
95+
$request->validate(['email' => 'required|email']);
96+
}
97+
98+
/**
99+
* Send a reset link to the given user.
100+
*
101+
* @param \Illuminate\Http\Request $request
102+
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
103+
*/
104+
public function sendResetLinkEmail(Request $request)
105+
{
106+
107+
$this->validateEmail($request);
108+
109+
// We will send the password reset link to this user. Once we have attempted
110+
// to send the link, we will examine the response then see the message we
111+
// need to show to the user. Finally, we'll send out a proper response.
112+
$response = $this->broker()->sendResetLink(
113+
$this->credentials($request)
114+
);
115+
116+
return $response == Password::RESET_LINK_SENT
117+
? $this->sendResetLinkResponse($request, $response)
118+
: $this->sendResetLinkFailedResponse($request, $response);
119+
}
53120
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"require": {
1111
"php": ">=7.3",
1212
"avored/banner": "^2.4",
13-
"avored/framework": "^3.2",
13+
"avored/framework": "~3.2",
14+
"darkghosthunter/rememberable-query": "^1.1",
1415
"fideloper/proxy": "^4.0"
1516
},
1617
"require-dev": {

resources/js/avored.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

2-
window.Vue = require('vue')
2+
import Vue from 'vue'
3+
4+
window.Vue = Vue
35

46
window.AvoRed = (function() {
57
return {

resources/lang/en/avored.php

Lines changed: 35 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,74 +24,52 @@
2424
'state' => 'State',
2525
'city' => 'City',
2626
'postcode' => 'Postcode',
27-
'fields' => [
28-
'email' => 'Email Address',
29-
'password' => 'Password',
30-
'first_name' => 'First Name',
31-
'last_name' => 'Last Name',
32-
'password_confirmation' => 'Confirm password',
33-
'image' => 'Image',
34-
'address2' => 'Address2',
35-
'company_name' => 'Company Name',
36-
'phone' => 'Phone',
37-
'address1' => 'Address 1',
38-
'postcode' => 'Postcode',
39-
'state' => 'State',
40-
'city' => 'City',
41-
'country_id' => 'Country'
42-
],
43-
'properties' => 'Properties',
44-
'my_wishlist' => 'My Wishlist',
45-
'customer_wishlists' => 'Customer Wishlists',
46-
'not_available' => 'Not Available',
47-
'add_to_cart' => 'Add To Cart',
48-
'add_to_wishlist' => 'Add To Wishlist',
49-
'remove_to_wishlist' => 'Remove from Wishlist',
50-
'availability' => 'Availability: Total In Stock',
5127
'home' => 'Home',
52-
'reset_password' => 'Reset Password',
28+
'orders' => 'Orders',
29+
'account' => 'Account',
30+
'edit' => 'Edit',
31+
'email' => 'Email',
32+
'account_edit' => 'Account Edit',
33+
'account_dashboard' => 'Account Dashboard',
34+
'edit_user_personal_info' => 'Edit User Personal Information',
35+
'update_your_password' => 'Update your password',
36+
'save' => 'Save',
37+
'cancel' => 'Cancel',
38+
'password' => 'Password',
39+
'password_confirmation' => 'Confirm Password',
40+
'my_wishlist' => 'My Wishlist',
41+
'user_personal_info' => 'User Personal Information',
42+
'login_title' => 'Login to your Account',
43+
'remember_me' => 'Remember me',
44+
'forgot_password' => 'Forgor your password?',
45+
'sign_in' => 'Sign in',
5346
'login' => 'Login',
54-
'password_update' => 'Update Password',
55-
'user_dashboard' => 'User Dashboard',
47+
'upload' => 'Upload',
48+
'upload_user_picture' => 'Upload User Picture',
49+
'image' => 'Image',
50+
'addresses' => 'Addresses',
51+
'edit_address' => 'Edit Address',
52+
'create_address' => 'Create Address',
53+
'create' => 'Create',
5654
'show_order' => 'Show Order',
57-
'cart' => 'Cart',
58-
'page' => 'Page',
55+
'add_to_cart' => 'Add to cart',
56+
'reset_password' => 'Reset Password',
57+
'password_update' => 'Update your password',
58+
'cart_page' => 'Cart Page',
5959
'product' => 'Product',
6060
'qty' => 'Qty',
6161
'unit_price' => 'Unit Price',
6262
'total_price' => 'Total Price',
6363
'subtotal' => 'Sub Total',
6464
'discount_coupon' => 'Discount Coupon',
65+
'apply' => 'Apply',
6566
'discount' => 'Discount',
6667
'total' => 'Total',
6768
'checkout' => 'Checkout',
68-
'user_personal_info' => 'User Personal Information',
69-
'user_shipping_address' => 'User Shipping Address',
70-
'user' => 'User',
71-
'billing_address' => 'Billing Address',
72-
'btn' => [
73-
'sign_in' => 'Sign In',
74-
'register' => 'Register',
75-
'save' => 'Save',
76-
'cancel' => 'Cancel',
77-
'create' => 'Create',
78-
'apply' => 'Apply',
79-
'place_order' => 'Place Order'
80-
],
81-
'pages' => [
82-
83-
'login' => [
84-
'title' => 'Login to your Account',
85-
'remember_me' => 'Remember Me',
86-
'forgot_password' => 'Forgot password?'
87-
],
88-
'register' => [
89-
'title' => 'Register your Account',
90-
],
91-
'account_dashboard' => [
92-
'title' => 'Dashboard'
93-
],
94-
95-
],
69+
'checkout_page' => 'Checkout Page',
70+
'user_shipping_address' => 'User shipping address',
71+
'place_order' => 'Place Order',
72+
'payment_options' => 'Payment Options',
73+
'cart_information' => 'Cart Information'
9674

9775
];

resources/views/account/address/_fields.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="mt-3 flex w-full">
1313
<div class="w-1/2">
1414
<avored-input
15-
label-text="{{ __('avored.fields.first_name') }}"
15+
label-text="{{ __('avored.first_name') }}"
1616
field-name="first_name"
1717
init-value="{{ $address->first_name ?? '' }}"
1818
error-text="{{ $errors->first('first_name') }}"
@@ -21,7 +21,7 @@
2121
</div>
2222
<div class="w-1/2 ml-3">
2323
<avored-input
24-
label-text="{{ __('avored.fields.last_name') }}"
24+
label-text="{{ __('avored.last_name') }}"
2525
field-name="last_name"
2626
init-value="{{ $address->last_name ?? '' }}"
2727
error-text="{{ $errors->first('last_name') }}"

resources/views/account/address/create.blade.php

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,44 @@
11
@extends('layouts.user')
22

33
@section('breadcrumb')
4-
<div class="flex">
5-
<div>
4+
<nav class="text-black bg-gray-400 rounded mb-5 py-2 px-5" aria-label="Breadcrumb">
5+
<ol class="list-none p-0 inline-flex">
6+
<li class="flex items-center">
67
<a href="{{ route('home') }}" class="text-gray-700" title="home">
7-
{{ __('Home') }} >>
8+
{{ __('avored.home') }}
89
</a>
9-
</div>
10-
<div class="ml-1">
11-
<a href="{{ route('account.dashboard') }}" class="text-gray-700" title="user dashboard">
12-
{{ __('User Dashboard') }} >>
10+
<svg class="fill-current w-3 h-3 mx-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg>
11+
</li>
12+
<li class="flex items-center">
13+
<a href="{{ route('account.dashboard') }}" class="text-gray-700" title="home">
14+
{{ __('avored.account_dashboard') }}
1315
</a>
14-
</div>
15-
<div class="ml-1">
16-
<a href="{{ route('account.address.index') }}" class="text-gray-700" title="user dashboard">
17-
{{ __('Addresses') }} >>
16+
<svg class="fill-current w-3 h-3 mx-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg>
17+
</li>
18+
<li class="flex items-center">
19+
<a href="{{ route('account.address.index') }}" class="text-gray-700" title="home">
20+
{{ __('avored.addresses') }}
1821
</a>
19-
</div>
20-
21-
<div class="ml-1 text-gray-700">
22-
{{ __('Create') }}
23-
</div>
24-
</div>
22+
<svg class="fill-current w-3 h-3 mx-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg>
23+
</li>
24+
<li class="flex items-center">
25+
<a href="#" class="text-gray-700" title="home">
26+
{{ __('avored.create_address') }}
27+
</a>
28+
</li>
29+
30+
</ol>
31+
</nav>
2532
@endsection
2633

2734
@section('content')
28-
<div class="flex">
29-
<div class="w-full">
30-
<h1 class="text-xl my-5 text-red-700">{{ __('Create Address') }}</h1>
35+
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
36+
<div class="px-4 py-5 sm:px-6">
37+
<div class="w-full flex">
38+
<h2 class="text-2xl text-red-700">{{ __('avored.create_address') }}</h2>
39+
</div>
40+
</div>
41+
<div class="border-t px-4 py-5 border-gray-200">
3142
<address-save inline-template>
3243
<div>
3344
<form method="post" action="{{ route('account.address.store') }}">
@@ -41,13 +52,13 @@ class="px-6 py-3 font-semibold leading-7 text-white hover:text-white bg-red-600
4152
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-flex w-4" fill="currentColor" viewBox="0 0 20 20">
4253
<path d="M0 2C0 .9.9 0 2 0h14l4 4v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5 0v6h10V2H5zm6 1h3v4h-3V3z"/>
4354
</svg>
44-
<span class="ml-3">{{ __('avored.btn.save') }}</span>
55+
<span class="ml-3">{{ __('avored.save') }}</span>
4556
</button>
4657

4758
<a href="{{ route('account.address.index') }}"
4859
class="px-6 py-3 font-semibold inline-block text-white leading-7 hover:text-white bg-gray-500 rounded hover:bg-gray-600">
4960
<span class="leading-7">
50-
{{ __('avored.btn.cancel') }}
61+
{{ __('avored.cancel') }}
5162
</span>
5263
</a>
5364
</div>

0 commit comments

Comments
 (0)