mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
register form step 1
This commit is contained in:
@@ -39,7 +39,7 @@ abstract class AbstractValidation
|
||||
$validator = $this->validator::make($this->data($object), $this->rules(), $this->messages());
|
||||
|
||||
if($validator->fails()) {
|
||||
throw new RequestValidationException($validator->messages());
|
||||
throw new RequestValidationException($validator->messages()->first());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -27,7 +27,7 @@ class CompanyValidation extends AbstractValidation
|
||||
{
|
||||
return [
|
||||
'company_name' => 'required',
|
||||
'company_reference' => 'required',
|
||||
'company_reference' => '',
|
||||
'type' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class ContactValidation extends AbstractValidation
|
||||
return [
|
||||
'country_id' => 'required',
|
||||
'company_id' => 'required',
|
||||
'contact_reference' => 'required',
|
||||
'contact_reference' => '',
|
||||
'phone' => 'required',
|
||||
'contact_email' => '',
|
||||
'wechat_id' => ''
|
||||
|
||||
Generated
+15253
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div class="row p-t-25 text-left">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="b-l b-success p-l-15 m-b-15" style="border-left-width: 3px;">
|
||||
<h6 class="bold all-caps no-margin text-success">Registration</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.name">
|
||||
<label class="muted">Name</label>
|
||||
<input class="form-control" name="name" v-model="parameters.name">
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.email">
|
||||
<label class="muted">Email</label>
|
||||
<input class="form-control" name="email" v-model="parameters.email">
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.company_name">
|
||||
<label class="muted">Company Name</label>
|
||||
<input class="form-control" name="company_name" v-model="parameters.company_name">
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.phone">
|
||||
<label class="muted">Phone</label>
|
||||
<input class="form-control" name="phone" v-model="parameters.phone">
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.password">
|
||||
<label class="muted">Password</label>
|
||||
<input class="form-control" type="password" name="password" v-model="parameters.password">
|
||||
</validation-wrapper-component>
|
||||
<validation-wrapper-component :validator="$v.parameters.password_confirmation">
|
||||
<label class="muted">Password Confirmation</label>
|
||||
<input class="form-control" type="password" name="password_confirmation" v-model="parameters.password_confirmation">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
<button type="button" class="btn btn-success" @click="submitForm()">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { required, email, sameAs, numeric } from "vuelidate/lib/validators";
|
||||
export default {
|
||||
props: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parameters : {
|
||||
name: '',
|
||||
email: '',
|
||||
company_name: '',
|
||||
phone: '',
|
||||
password: '',
|
||||
password_confirmation: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
parameters: {
|
||||
name: { required },
|
||||
email: { required, email },
|
||||
company_name: { required },
|
||||
phone: { required, numeric },
|
||||
password: { required },
|
||||
password_confirmation: { required, sameAsPassword: sameAs('password') }
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
submitForm(){
|
||||
this.submit((this.route('api.account.registration')), 'post', 'registrationSection', true, true)
|
||||
},
|
||||
errorHandler(){
|
||||
console.log('nononon');
|
||||
},
|
||||
successHandler(){
|
||||
console.log('yess');
|
||||
this.crudSuccess();
|
||||
EventBus.$emit('updateAddress')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<registration-form-component ref="registration" :section="'RegistrationSection'"></registration-form-component>
|
||||
@endSection
|
||||
@@ -17,6 +17,11 @@ Route::get('', function () {
|
||||
return view('pages.accounts.authentication.login');
|
||||
})->name('login');
|
||||
|
||||
|
||||
Route::get('account/registration', function () {
|
||||
return view('pages.accounts.registration');
|
||||
})->name('login');
|
||||
|
||||
Route::get('account/password/reset/{token}', function ($token){
|
||||
return view('pages.accounts.authentication.reset_password',['token' => $token]);
|
||||
})->name('account.password.reset');
|
||||
|
||||
Reference in New Issue
Block a user