mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/izyim into order-search
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\ControllersLogic\Accounts;
|
||||
|
||||
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\UserInvitationObject;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesUserInvitation;
|
||||
use App\Classes\Modules\Accounts\Validation\CanSendAccountInvitation;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Modules\ControllerLogic\Exceptions\ResourceConflictException;
|
||||
use App\Classes\ValueObjects\Constants\HttpStatus;
|
||||
use App\Events\Accounts\UserInvited;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ForgotAccountLogic
|
||||
{
|
||||
|
||||
/** @var CreatesUserInvitation */
|
||||
private $createUserInvitation;
|
||||
|
||||
/** @var CanSendAccountInvitation */
|
||||
private $canSendAccountInvitation;
|
||||
|
||||
/**
|
||||
* CreateAccountInvitationLogic constructor.
|
||||
* @param CreatesUserInvitation $createUserInvitation
|
||||
* @param CanSendAccountInvitation $canSendAccountInvitation
|
||||
*/
|
||||
public function __construct(CreatesUserInvitation $createUserInvitation, CanSendAccountInvitation $canSendAccountInvitation)
|
||||
{
|
||||
$this->createUserInvitation = $createUserInvitation;
|
||||
$this->canSendAccountInvitation = $canSendAccountInvitation;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws InternalServerErrorException
|
||||
*/
|
||||
public function execute(Request $request) {
|
||||
|
||||
try {
|
||||
|
||||
$object = new UserInvitationObject($request->get('role_id'), $request->get('email'));
|
||||
|
||||
if($this->canSendAccountInvitation->execute($object)){
|
||||
|
||||
|
||||
$invitation = $this->createUserInvitation->execute($object);
|
||||
|
||||
event(new UserInvited($invitation));
|
||||
|
||||
return new JsonResponse("Invitation have been sent!", HttpStatus::RESOURCE_CREATED);
|
||||
}
|
||||
|
||||
} catch (ResourceConflictException $exception) {
|
||||
throw new InternalServerErrorException("Failed to send user invitation because {$exception->getMessage()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
//namespace App\Http\Controllers\Account;
|
||||
//
|
||||
//use App\Classes\Modules\ControllersLogic\Accounts\ForgotAccountLogic;
|
||||
//use App\Http\Controllers\Controller;
|
||||
//use Illuminate\Http\JsonResponse;
|
||||
//use Illuminate\Http\RedirectResponse;
|
||||
//use Illuminate\Http\Request;
|
||||
//
|
||||
//class ForgotAccountController extends Controller
|
||||
//{
|
||||
// /**
|
||||
// * @param Request $request
|
||||
// * @param ForgotAccountLogic $logic
|
||||
// * @return JsonResponse
|
||||
// * @throws \App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException
|
||||
// * @throws \App\Classes\Modules\ControllerLogic\Exceptions\MalformedRequestException
|
||||
// */
|
||||
// public function forgot(Request $request, ForgotAccountLogic $logic): JsonResponse
|
||||
// {
|
||||
// return $logic->execute($request);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
namespace App\Http\Controllers\Account;
|
||||
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class ForgotAccountController extends Controller
|
||||
{
|
||||
/**
|
||||
* Send an e-mail reminder to the user.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function forgot()
|
||||
{
|
||||
|
||||
Mail::send('emails.reminder', ['user' => "ahmad"], function ($m) {
|
||||
$m->from('2f114cfc66-6c1272@inbox.mailtrap.io', 'Your Application');
|
||||
|
||||
$m->to("2f114cfc66-6c1272@inbox.mailtrap.io", "ahmad")->subject('Your Reminder!');
|
||||
});
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "laravel/laravel",
|
||||
"name": "izyim/izyim",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
|
||||
@@ -6,10 +6,10 @@ $factory->define(App\Models\Package::class, function (Faker $faker) {
|
||||
return [
|
||||
'list_id' => $faker->numberBetween(1, 300),
|
||||
'description' => $faker->realText(10),
|
||||
'width' => $faker->numberBetween(1, 999),
|
||||
'length' => $faker->numberBetween(1, 999),
|
||||
'height' => $faker->numberBetween(1, 999),
|
||||
'quantity' => $faker->numberBetween(1, 50),
|
||||
'width' => $faker->numberBetween(1, 99),
|
||||
'length' => $faker->numberBetween(1, 99),
|
||||
'height' => $faker->numberBetween(1, 99),
|
||||
'quantity' => $faker->numberBetween(1, 5),
|
||||
'created_at' => $faker->dateTimeBetween($startDate = '-30 days', $endDate = '30 days'),
|
||||
'updated_at' => $faker->dateTimeBetween($startDate = '-30 days', $endDate = '30 days')
|
||||
];
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
<div class="col p-r-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0">
|
||||
<input type="text" class="form-control no-border" v-model="query" @keyup="search()" :placeholder="placeholder" id="icon-filter" name="icon-filter">
|
||||
<input type="text" class="form-control no-border" v-model="query" @keyup="search()" :placeholder="placeholder" id="icon-filter" name="icon-filter" autocomplete="off">
|
||||
</div>
|
||||
<div class="col-auto bg-white pointer" @click="closeSearch()">
|
||||
<i class="fa fa-times fs-10 muted lh-35"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin" :class="{'hide': !isActive}">
|
||||
<div class="col b-t b-grey no-padding absolute w-100 bg-white" style="z-index: 1; box-shadow: 0px 1px 8px -4px rgba(0,0,0,0.75);">
|
||||
<div class="col b-t b-grey no-padding absolute w-100 bg-white" style="z-index: 999; box-shadow: 0px 1px 8px -4px rgba(0,0,0,0.75);">
|
||||
<div class="row no-margin b-b b-grey" v-for="result in results" v-bind:key="result.id">
|
||||
<div class="col">
|
||||
<a :href="route('companies.profile', {companyId: result.id})">
|
||||
|
||||
@@ -15,27 +15,27 @@
|
||||
<div class="col no-padding">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Marking</label>
|
||||
<input class="form-control" name="marking" v-model="company.marking">
|
||||
<input class="form-control" name="marking" v-model="company.marking" autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Company Name</label>
|
||||
<input class="form-control" name="name" v-model="company.name">
|
||||
<input class="form-control" name="name" v-model="company.name" autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Email Address</label>
|
||||
<input class="form-control" name="email" v-model="company.email">
|
||||
<input class="form-control" name="email" v-model="company.email" autocomplete="off">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-l-0">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Registration Number</label>
|
||||
<input class="form-control" name="registration_no" v-model="company.registration_no">
|
||||
<input class="form-control" name="registration_no" v-model="company.registration_no" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-r-0">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Tax Number</label>
|
||||
<input class="form-control" name="tax_no" v-model="company.tax_no">
|
||||
<input class="form-control" name="tax_no" v-model="company.tax_no" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
<div class="col no-padding">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Address Line 1</label>
|
||||
<input class="form-control" name="street_one" v-model="address.street_one" @change="changeAddress()">
|
||||
<input class="form-control" name="street_one" v-model="address.street_one" @change="changeAddress()" autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group form-group-default">
|
||||
<label class="muted">Address Line 2</label>
|
||||
<input class="form-control" name="street_two" v-model="address.street_two" @change="changeAddress()">
|
||||
<input class="form-control" name="street_two" v-model="address.street_two" @change="changeAddress()" autocomplete="off">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-l-0">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">City</label>
|
||||
<input class="form-control" name="city" v-model="address.city" @change="changeAddress()">
|
||||
<input class="form-control" name="city" v-model="address.city" @change="changeAddress()" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-r-0">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">State</label>
|
||||
<input class="form-control" name="state" v-model="address.state" @change="changeAddress()">
|
||||
<input class="form-control" name="state" v-model="address.state" @change="changeAddress()" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="col-5 p-l-0">
|
||||
<div class="form-group form-group-default required">
|
||||
<label class="muted">Post Code</label>
|
||||
<input class="form-control" name="post_code" v-model="address.post_code" @change="changeAddress()">
|
||||
<input class="form-control" name="post_code" v-model="address.post_code" @change="changeAddress()" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-r-0">
|
||||
|
||||
@@ -73,6 +73,25 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-l-5 p-r-0">
|
||||
<div class="form-group form-group-default input-group">
|
||||
<div class="row w-100">
|
||||
<div class="col no-padding">
|
||||
<label class="muted block">Length</label>
|
||||
<input class="form-control block" v-model="item.length" v-on:keypress="isNumber(true)">
|
||||
</div>
|
||||
<div class="col-auto no-padding">
|
||||
<div class="input-group-addon inline" style="min-width:auto;">
|
||||
<div class="row align-items-center justify-content-center h-100">
|
||||
<div class="col no-padding text-center">
|
||||
<small>cm</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-0 p-r-5">
|
||||
<div class="form-group form-group-default input-group">
|
||||
<div class="row w-100">
|
||||
@@ -111,25 +130,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-5 p-r-0">
|
||||
<div class="form-group form-group-default input-group">
|
||||
<div class="row w-100">
|
||||
<div class="col no-padding">
|
||||
<label class="muted block">Length</label>
|
||||
<input class="form-control block" v-model="item.length" v-on:keypress="isNumber(true)">
|
||||
</div>
|
||||
<div class="col-auto no-padding">
|
||||
<div class="input-group-addon inline" style="min-width:auto;">
|
||||
<div class="row align-items-center justify-content-center h-100">
|
||||
<div class="col no-padding text-center">
|
||||
<small>cm</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
<div class="row m-t-5">
|
||||
<div class="col no-padding">
|
||||
<small class="text-complete">Forgot your password?</small>
|
||||
<a href="{{ route("password.forgot") }}"><small class="text-complete">Forgot your password?</small></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
@extends('layouts.base')
|
||||
|
||||
@section('content')
|
||||
<div class="fluid-container h-100">
|
||||
<div class="row no-margin" style=" min-height: 100%; ">
|
||||
<div class="col no-padding" style="background-image: url({{asset('images/shipping_bg.jpeg')}}); background-position: center; background-size: cover;">
|
||||
<div class="w-100 h-100 bg-primary" style="position: absolute; opacity: 0.1;"></div>
|
||||
</div>
|
||||
<div class="col-4 padding-50 bg-white">
|
||||
<div class="row m-t-50">
|
||||
<div class="col m-t-50 p-l-0">
|
||||
<img src="{{asset('images/logo.png')}}" alt="logo" height="35">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-50">
|
||||
<div class="col">
|
||||
<div class="inline v-align-middle">
|
||||
<h4 class="font-heading no-margin lh-28">Change Your Password</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@if($errors->any())
|
||||
@foreach ($errors->all() as $error)
|
||||
<div class="error">{{ $error }}</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<form method="post" id="form-login" class="p-t-15" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
<div class="form-group form-group-default">
|
||||
<label>Email</label>
|
||||
<div class="controls">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" placeholder="Your Email" required autofocus>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-group-default">
|
||||
<label>Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" class="form-control" name="password" placeholder="Credentials" required>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-group-default">
|
||||
<label>Confirm Password</label>
|
||||
<div class="controls">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" placeholder="Credentials" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-end align-items-end">
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary btn-cons m-t-10 pull-right m-r-0">Change</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{--<form method="POST" action="{{ route('password.update') }}">--}}
|
||||
{{--@csrf--}}
|
||||
|
||||
{{--<input type="hidden" name="token" value="{{ $token }}">--}}
|
||||
|
||||
{{--<div class="form-group row">--}}
|
||||
{{--<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>--}}
|
||||
|
||||
{{--<div class="col-md-6">--}}
|
||||
{{--<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus>--}}
|
||||
|
||||
{{--@if ($errors->has('email'))--}}
|
||||
{{--<span class="invalid-feedback" role="alert">--}}
|
||||
{{--<strong>{{ $errors->first('email') }}</strong>--}}
|
||||
{{--</span>--}}
|
||||
{{--@endif--}}
|
||||
{{--</div>--}}
|
||||
{{--</div>--}}
|
||||
|
||||
{{--<div class="form-group row">--}}
|
||||
{{--<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>--}}
|
||||
|
||||
{{--<div class="col-md-6">--}}
|
||||
{{--<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>--}}
|
||||
|
||||
{{--@if ($errors->has('password'))--}}
|
||||
{{--<span class="invalid-feedback" role="alert">--}}
|
||||
{{--<strong>{{ $errors->first('password') }}</strong>--}}
|
||||
{{--</span>--}}
|
||||
{{--@endif--}}
|
||||
{{--</div>--}}
|
||||
{{--</div>--}}
|
||||
|
||||
{{--<div class="form-group row">--}}
|
||||
{{--<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>--}}
|
||||
|
||||
{{--<div class="col-md-6">--}}
|
||||
{{--<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>--}}
|
||||
{{--</div>--}}
|
||||
{{--</div>--}}
|
||||
|
||||
{{--<div class="form-group row mb-0">--}}
|
||||
{{--<div class="col-md-6 offset-md-4">--}}
|
||||
{{--<button type="submit" class="btn btn-primary">--}}
|
||||
{{--{{ __('Reset Password') }}--}}
|
||||
{{--</button>--}}
|
||||
{{--</div>--}}
|
||||
{{--</div>--}}
|
||||
{{--</form>--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.base')
|
||||
|
||||
@section('content')
|
||||
@if (session('status'))
|
||||
<div class="fluid-container h-100">
|
||||
<div class="row no-margin" style="min-height: 100%; ">
|
||||
<div class="card no-margin" style="background-image: url({{asset('images/shipping_bg.jpeg')}}); background-position: center; background-size: cover;">
|
||||
<div class="card-body row align-items-center justify-content-center">
|
||||
<div class="col-5 padding-50 bg-white text-center">
|
||||
<div class="password_panel">
|
||||
<div class="password_desc">
|
||||
<i class="text-success fs-40 block"></i>
|
||||
<h5 class="font-heading bold">We just sent an email to reset your password</h5>
|
||||
<p class="text-muted no-margin p-b-20">Click on the link we've sent you to reset your password.
|
||||
if you have not received an email, Please check your spambox</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col no-padding text-center">
|
||||
<a href="{{ route('login') }}">
|
||||
<button class="btn btn-primary">Back to Login</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="fluid-container h-100">
|
||||
<div class="row no-margin" style=" min-height: 100%; ">
|
||||
<div class="col no-padding" style="background-image: url({{asset('images/shipping_bg.jpeg')}}); background-position: center; background-size: cover;">
|
||||
<div class="w-100 h-100 bg-primary" style="position: absolute; opacity: 0.1;"></div>
|
||||
</div>
|
||||
<div class="col-4 padding-50 bg-white">
|
||||
<div class="row m-t-50">
|
||||
<div class="col m-t-50 p-l-0">
|
||||
<img src="{{asset('images/logo.png')}}" alt="logo" height="35">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-50">
|
||||
<div class="col">
|
||||
<div class="inline v-align-middle">
|
||||
<h4 class="font-heading no-margin lh-28">Forget Your Password</h4>
|
||||
<p class="no-margin hint-text lh-18">Reset it using your credentials</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@if($errors->any())
|
||||
@foreach ($errors->all() as $error)
|
||||
<div class="error">{{ $error }}</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group form-group-default">
|
||||
<label>Username</label>
|
||||
<div class="controls">
|
||||
<input name="email" placeholder="Email Address" id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-end align-items-end">
|
||||
<div class="col-auto">
|
||||
{{ csrf_field() }}
|
||||
<button class="btn btn-primary btn-cons m-t-10 pull-right m-r-0">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@@ -9,6 +9,15 @@ Route::group(['prefix' => 'auth'], function () {
|
||||
|
||||
Route::post('/registration/create', 'Account\RegisterAccountController@register')->name('auth.registration.create');
|
||||
|
||||
Route::get('password/forgot', function () {
|
||||
return view('pages.authentication.password.forgot');
|
||||
})->name('password.forgot');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
|
||||
Route::get('password/reset/{token}', function ($token){
|
||||
return view('pages.authentication.password.change',['token' => $token]);
|
||||
})->name('password.reset');
|
||||
Route::post('password/update', 'Auth\ResetPasswordController@reset')->name('password.update');
|
||||
|
||||
Route::get('/logout', 'Auth\LoginController@logout')->name('auth.logout');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user