Skip to content

Commit

Permalink
Merge pull request #534 from avored/developed
Browse files Browse the repository at this point in the history
Developed
  • Loading branch information
indpurvesh authored Feb 6, 2021
2 parents 41d7d84 + 134989b commit e43d712
Show file tree
Hide file tree
Showing 30 changed files with 696 additions and 489 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Account/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DashboardController extends Controller
*/
public function index()
{
$user = Auth::user();
$user = Auth::guard('customer')->user();
return view('account.dashboard', compact('user'));
}
}
73 changes: 70 additions & 3 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Password;

Expand All @@ -19,9 +20,7 @@ class ForgotPasswordController extends Controller
| your application to your users. Feel free to explore this trait.
|
*/

use SendsPasswordResetEmails;


/**
* Create a new controller instance.
*
Expand Down Expand Up @@ -50,4 +49,72 @@ public function broker()
{
return Password::broker('customers');
}


/**
* Display the form to request a password reset link.
*
* @return \Illuminate\Http\Response
*/
public function showLinkRequestForm()
{
return view('auth.passwords.email');
}

/**
* Get the response for a successful password reset link.
*
* @param \Illuminate\Http\Request $request
* @param string $response
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
protected function sendResetLinkResponse(Request $request, $response)
{
return back()->with('status', trans($response));
}


/**
* Get the needed authentication credentials from the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
protected function credentials(Request $request)
{
return $request->only('email');
}
/**
* Validate the email for the given request.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function validateEmail(Request $request)
{
$request->validate(['email' => 'required|email']);
}

/**
* Send a reset link to the given user.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
*/
public function sendResetLinkEmail(Request $request)
{

$this->validateEmail($request);

// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$this->credentials($request)
);

return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($request, $response)
: $this->sendResetLinkFailedResponse($request, $response);
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"require": {
"php": ">=7.3",
"avored/banner": "^2.4",
"avored/framework": "^3.2",
"avored/framework": "~3.2",
"darkghosthunter/rememberable-query": "^1.1",
"fideloper/proxy": "^4.0"
},
"require-dev": {
Expand Down
4 changes: 3 additions & 1 deletion resources/js/avored.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

window.Vue = require('vue')
import Vue from 'vue'

window.Vue = Vue

window.AvoRed = (function() {
return {
Expand Down
92 changes: 35 additions & 57 deletions resources/lang/en/avored.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,74 +24,52 @@
'state' => 'State',
'city' => 'City',
'postcode' => 'Postcode',
'fields' => [
'email' => 'Email Address',
'password' => 'Password',
'first_name' => 'First Name',
'last_name' => 'Last Name',
'password_confirmation' => 'Confirm password',
'image' => 'Image',
'address2' => 'Address2',
'company_name' => 'Company Name',
'phone' => 'Phone',
'address1' => 'Address 1',
'postcode' => 'Postcode',
'state' => 'State',
'city' => 'City',
'country_id' => 'Country'
],
'properties' => 'Properties',
'my_wishlist' => 'My Wishlist',
'customer_wishlists' => 'Customer Wishlists',
'not_available' => 'Not Available',
'add_to_cart' => 'Add To Cart',
'add_to_wishlist' => 'Add To Wishlist',
'remove_to_wishlist' => 'Remove from Wishlist',
'availability' => 'Availability: Total In Stock',
'home' => 'Home',
'reset_password' => 'Reset Password',
'orders' => 'Orders',
'account' => 'Account',
'edit' => 'Edit',
'email' => 'Email',
'account_edit' => 'Account Edit',
'account_dashboard' => 'Account Dashboard',
'edit_user_personal_info' => 'Edit User Personal Information',
'update_your_password' => 'Update your password',
'save' => 'Save',
'cancel' => 'Cancel',
'password' => 'Password',
'password_confirmation' => 'Confirm Password',
'my_wishlist' => 'My Wishlist',
'user_personal_info' => 'User Personal Information',
'login_title' => 'Login to your Account',
'remember_me' => 'Remember me',
'forgot_password' => 'Forgor your password?',
'sign_in' => 'Sign in',
'login' => 'Login',
'password_update' => 'Update Password',
'user_dashboard' => 'User Dashboard',
'upload' => 'Upload',
'upload_user_picture' => 'Upload User Picture',
'image' => 'Image',
'addresses' => 'Addresses',
'edit_address' => 'Edit Address',
'create_address' => 'Create Address',
'create' => 'Create',
'show_order' => 'Show Order',
'cart' => 'Cart',
'page' => 'Page',
'add_to_cart' => 'Add to cart',
'reset_password' => 'Reset Password',
'password_update' => 'Update your password',
'cart_page' => 'Cart Page',
'product' => 'Product',
'qty' => 'Qty',
'unit_price' => 'Unit Price',
'total_price' => 'Total Price',
'subtotal' => 'Sub Total',
'discount_coupon' => 'Discount Coupon',
'apply' => 'Apply',
'discount' => 'Discount',
'total' => 'Total',
'checkout' => 'Checkout',
'user_personal_info' => 'User Personal Information',
'user_shipping_address' => 'User Shipping Address',
'user' => 'User',
'billing_address' => 'Billing Address',
'btn' => [
'sign_in' => 'Sign In',
'register' => 'Register',
'save' => 'Save',
'cancel' => 'Cancel',
'create' => 'Create',
'apply' => 'Apply',
'place_order' => 'Place Order'
],
'pages' => [

'login' => [
'title' => 'Login to your Account',
'remember_me' => 'Remember Me',
'forgot_password' => 'Forgot password?'
],
'register' => [
'title' => 'Register your Account',
],
'account_dashboard' => [
'title' => 'Dashboard'
],

],
'checkout_page' => 'Checkout Page',
'user_shipping_address' => 'User shipping address',
'place_order' => 'Place Order',
'payment_options' => 'Payment Options',
'cart_information' => 'Cart Information'

];
4 changes: 2 additions & 2 deletions resources/views/account/address/_fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="mt-3 flex w-full">
<div class="w-1/2">
<avored-input
label-text="{{ __('avored.fields.first_name') }}"
label-text="{{ __('avored.first_name') }}"
field-name="first_name"
init-value="{{ $address->first_name ?? '' }}"
error-text="{{ $errors->first('first_name') }}"
Expand All @@ -21,7 +21,7 @@
</div>
<div class="w-1/2 ml-3">
<avored-input
label-text="{{ __('avored.fields.last_name') }}"
label-text="{{ __('avored.last_name') }}"
field-name="last_name"
init-value="{{ $address->last_name ?? '' }}"
error-text="{{ $errors->first('last_name') }}"
Expand Down
55 changes: 33 additions & 22 deletions resources/views/account/address/create.blade.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
@extends('layouts.user')

@section('breadcrumb')
<div class="flex">
<div>
<nav class="text-black bg-gray-400 rounded mb-5 py-2 px-5" aria-label="Breadcrumb">
<ol class="list-none p-0 inline-flex">
<li class="flex items-center">
<a href="{{ route('home') }}" class="text-gray-700" title="home">
{{ __('Home') }} >>
{{ __('avored.home') }}
</a>
</div>
<div class="ml-1">
<a href="{{ route('account.dashboard') }}" class="text-gray-700" title="user dashboard">
{{ __('User Dashboard') }} >>
<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>
</li>
<li class="flex items-center">
<a href="{{ route('account.dashboard') }}" class="text-gray-700" title="home">
{{ __('avored.account_dashboard') }}
</a>
</div>
<div class="ml-1">
<a href="{{ route('account.address.index') }}" class="text-gray-700" title="user dashboard">
{{ __('Addresses') }} >>
<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>
</li>
<li class="flex items-center">
<a href="{{ route('account.address.index') }}" class="text-gray-700" title="home">
{{ __('avored.addresses') }}
</a>
</div>

<div class="ml-1 text-gray-700">
{{ __('Create') }}
</div>
</div>
<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>
</li>
<li class="flex items-center">
<a href="#" class="text-gray-700" title="home">
{{ __('avored.create_address') }}
</a>
</li>

</ol>
</nav>
@endsection

@section('content')
<div class="flex">
<div class="w-full">
<h1 class="text-xl my-5 text-red-700">{{ __('Create Address') }}</h1>
<div class="bg-white shadow overflow-hidden sm:rounded-lg">
<div class="px-4 py-5 sm:px-6">
<div class="w-full flex">
<h2 class="text-2xl text-red-700">{{ __('avored.create_address') }}</h2>
</div>
</div>
<div class="border-t px-4 py-5 border-gray-200">
<address-save inline-template>
<div>
<form method="post" action="{{ route('account.address.store') }}">
Expand All @@ -41,13 +52,13 @@ class="px-6 py-3 font-semibold leading-7 text-white hover:text-white bg-red-600
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 inline-flex w-4" fill="currentColor" viewBox="0 0 20 20">
<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"/>
</svg>
<span class="ml-3">{{ __('avored.btn.save') }}</span>
<span class="ml-3">{{ __('avored.save') }}</span>
</button>

<a href="{{ route('account.address.index') }}"
class="px-6 py-3 font-semibold inline-block text-white leading-7 hover:text-white bg-gray-500 rounded hover:bg-gray-600">
<span class="leading-7">
{{ __('avored.btn.cancel') }}
{{ __('avored.cancel') }}
</span>
</a>
</div>
Expand Down
Loading

0 comments on commit e43d712

Please sign in to comment.