Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fazo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nuriddin
fazo
Commits
aeaeaab2
Commit
aeaeaab2
authored
Oct 18, 2019
by
Khumoyunmirzo Sodiqov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
fb1be3bf
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
186 additions
and
160 deletions
+186
-160
.env
.env
+4
-4
LoginController.php
app/Http/Controllers/Auth/LoginController.php
+1
-1
RegisterController.php
app/Http/Controllers/Auth/RegisterController.php
+5
-1
Controller.php
app/Http/Controllers/Controller.php
+6
-0
ProfileController.php
app/Http/Controllers/ProfileController.php
+3
-3
RedirectIfAuthenticated.php
app/Http/Middleware/RedirectIfAuthenticated.php
+1
-1
User.php
app/User.php
+12
-3
composer.lock
composer.lock
+52
-89
login.blade.php
resources/views/auth/login.blade.php
+1
-1
register.blade.php
resources/views/auth/register.blade.php
+47
-14
addresses.blade.php
resources/views/pages/profile/addresses.blade.php
+39
-32
user.blade.php
resources/views/pages/profile/user.blade.php
+15
-11
No files found.
.env
View file @
aeaeaab2
...
...
@@ -7,11 +7,11 @@ APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=
nobletech.co
DB_HOST=
127.0.0.1
DB_PORT=3306
DB_DATABASE=fazo
DB_USERNAME=
iego
DB_PASSWORD=
3448844
DB_DATABASE=
erp
fazo
DB_USERNAME=
root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
...
...
app/Http/Controllers/Auth/LoginController.php
View file @
aeaeaab2
...
...
@@ -25,7 +25,7 @@ class LoginController extends Controller
*
* @var string
*/
protected
$redirectTo
=
'/
home
'
;
protected
$redirectTo
=
'/
packages
'
;
/**
* Create a new controller instance.
...
...
app/Http/Controllers/Auth/RegisterController.php
View file @
aeaeaab2
...
...
@@ -28,7 +28,7 @@ class RegisterController extends Controller
*
* @var string
*/
protected
$redirectTo
=
'/
home
'
;
protected
$redirectTo
=
'/
packages
'
;
/**
* Create a new controller instance.
...
...
@@ -50,6 +50,7 @@ class RegisterController extends Controller
{
return
Validator
::
make
(
$data
,
[
'name'
=>
[
'required'
,
'string'
,
'max:255'
],
'surname'
=>
[
'required'
,
'string'
,
'max:255'
],
'email'
=>
[
'required'
,
'string'
,
'email'
,
'max:255'
,
'unique:users'
],
'password'
=>
[
'required'
,
'string'
,
'min:8'
,
'confirmed'
],
]);
...
...
@@ -65,8 +66,11 @@ class RegisterController extends Controller
{
return
User
::
create
([
'name'
=>
$data
[
'name'
],
'surname'
=>
$data
[
'surname'
],
'email'
=>
$data
[
'email'
],
'password'
=>
Hash
::
make
(
$data
[
'password'
]),
'uni_code'
=>
$this
->
generateUniqNumber
(),
'client_type'
=>
'WEB'
,
]);
}
}
app/Http/Controllers/Controller.php
View file @
aeaeaab2
...
...
@@ -10,4 +10,10 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class
Controller
extends
BaseController
{
use
AuthorizesRequests
,
DispatchesJobs
,
ValidatesRequests
;
function
generateUniqNumber
(
$digit
=
6
)
{
return
(
int
)
substr
(
number_format
(
time
()
*
rand
(),
0
,
''
,
''
),
0
,
$digit
);
}
}
app/Http/Controllers/ProfileController.php
View file @
aeaeaab2
...
...
@@ -300,8 +300,8 @@ class ProfileController extends Controller
try
{
$user
=
User
::
find
(
Auth
::
user
()
->
id
);
$user
->
firstname
=
$request
->
input
(
'first
name'
);
$user
->
lastname
=
$request
->
input
(
'last
name'
);
$user
->
name
=
$request
->
input
(
'
name'
);
$user
->
surname
=
$request
->
input
(
'sur
name'
);
$user
->
email
=
$request
->
input
(
'email'
);
$user
->
phone
=
$request
->
input
(
'phone'
);
...
...
@@ -316,4 +316,4 @@ class ProfileController extends Controller
return
redirect
()
->
back
()
->
with
(
'success'
,
'Информация успешно сохранена.'
);
}
}
\ No newline at end of file
}
app/Http/Middleware/RedirectIfAuthenticated.php
View file @
aeaeaab2
...
...
@@ -18,7 +18,7 @@ class RedirectIfAuthenticated
public
function
handle
(
$request
,
Closure
$next
,
$guard
=
null
)
{
if
(
Auth
::
guard
(
$guard
)
->
check
())
{
return
redirect
(
'/p
rofile
'
);
return
redirect
(
'/p
ackages
'
);
}
return
$next
(
$request
);
...
...
app/User.php
View file @
aeaeaab2
...
...
@@ -10,13 +10,18 @@ class User extends Authenticatable
{
use
Notifiable
;
protected
$table
=
'clients'
;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected
$fillable
=
[
'name'
,
'email'
,
'password'
,
'name'
,
'surname'
,
'birthday'
,
'sex'
,
'passport'
,
'passport_issue'
,
'passport_by'
,
'country_id'
,
'city_id'
,
'street'
,
'house'
,
'apartment'
,
'phone'
,
'mobile'
,
'email'
,
'add_operator_id'
,
'edit_operator_id'
,
'added'
,
'edited'
,
'orders'
,
'last_order'
,
'allowed'
,
'status'
,
'uni_code'
,
'lang_id'
,
'password'
,
'remember_token'
,
'scan_id'
,
'client_type'
];
/**
...
...
@@ -34,11 +39,15 @@ class User extends Authenticatable
* @var array
*/
protected
$casts
=
[
'email_verified_at'
=>
'datetime'
,
'added'
=>
'datetime'
,
'edited'
=>
'datetime'
,
'last_order'
=>
'datetime'
,
];
public
$timestamps
=
false
;
public
function
getFIO
()
{
return
$this
->
firstname
.
' '
.
$this
->
last
name
;
return
$this
->
name
.
' '
.
$this
->
sur
name
;
}
}
composer.lock
View file @
aeaeaab2
This diff is collapsed.
Click to expand it.
resources/views/auth/login.blade.php
View file @
aeaeaab2
...
...
@@ -39,7 +39,7 @@
<div class="
col
-
md
-
8
offset
-
md
-
4
mt
-
4
">
Впервые у нас?
<span class="
text
-
muted
">
<a class="" href="
{{
route
(
'register'
)
}}
">
<a class="" href="
/
register
">
Регистрация.
</a>
</span>
...
...
resources/views/auth/register.blade.php
View file @
aeaeaab2
...
...
@@ -13,35 +13,68 @@
@csrf
<div class="
form
-
wrap
">
<input class="
form
-
input
" id="
name
" type="
text
" name="
name
"
placeholder="
Имя
">
placeholder="
Имя
">
@if (
$errors->has
('name'))
<span class="
invalid
-
feedback
" role="
alert
">
<strong>{{
$errors->first
('name') }}</strong>
</span>
@endif
</div>
<div class="
form
-
wrap
">
<input class="
form
-
input
" id="
name
" type="
text
" name="
surname
"
placeholder="
Фамиля
">
@if (
$errors->has
('surname'))
<span class="
invalid
-
feedback
" role="
alert
">
<strong>{{
$errors->first
('surname') }}</strong>
</span>
@endif
</div>
<div class="
form
-
wrap
">
<input class="
form
-
input
" id="
email
" type="
email
" name="
email
"
placeholder="
email
">
placeholder="
email
">
@if (
$errors->has
('email'))
<span class="
invalid
-
feedback
" role="
alert
">
<strong>{{
$errors->first
('email') }}</strong>
</span>
@endif
</div>
<div class="
form
-
wrap
">
<input class="
form
-
input
" id="
password
" type="
password
" name="
password
"
placeholder="
Пароль
">
placeholder="
Пароль
">
</div>
<div class="
form
-
wrap
">
<input class="
form
-
input
" id="
password
-
confirm
" type="
password
" name="
password_confirmation
"
placeholder="
Подтверждение
пароля
">
<input class="
form
-
input
" id="
password
-
confirm
" type="
password
"
name="
password_confirmation
"
placeholder="
Подтверждение
пароля
">
@if (
$errors->has
('password'))
<span class="
invalid
-
feedback
" role="
alert
">
<strong>{{
$errors->first
('password') }}</strong>
</span>
@endif
</div>
<div class="
button
-
wrap
text
-
center
">
<button class="
btn
btn
-
primary
btn
-
sm
btn
-
min
-
width
-
lg
" type="
submit
">
<div class="
button
-
wrap
text
-
center
" style="
padding
-
top
:
15
px
">
<button type="
submit
" class="
btn
btn
-
primary
btn
-
sm
btn
-
min
-
width
-
lg
">
Зарегистрироваться
</button>
</div>
<div class="
form
-
group
row
mb
-
0
" style="
padding
-
top
:
15
px
">
<div class="
col
-
md
-
12
offset
-
md
-
4
mt
-
4
">
Если у вас есть аккаунт,
<span class="
text
-
muted
">
<a class="" href="
{{
route
(
'login'
)
}}
">
Войдите
</a>
</span>
</div>
</div>
</form>
<p class="
text
-
uppercase
text
-
gray
offset
-
7
">или</p>
{{-- <p class="
text
-
uppercase
text
-
gray
offset
-
7
">или</p>--}}
</div>
</div>
<div class="
btn
-
group
-
variant
"><a class="
btn
btn
-
info
-
2
btn
-
sm
btn
-
icon
" href="
#"><span
class
="
icon
fa
-
facebook
"></span> Facebook</a><a class="
btn
btn
-
info
btn
-
sm
btn
-
icon
"
href="
#"><span
class
="
icon
fa
-
twitter
"></span> Twitter</a><a class="
btn
btn
-
danger
btn
-
sm
btn
-
icon
"
href="
#"><span
class
="
icon
fa
-
google
-
plus
"></span> Google+</a></div>
</div>
</div>
</div>
...
...
resources/views/pages/profile/addresses.blade.php
View file @
aeaeaab2
...
...
@@ -2,31 +2,32 @@
@
section
(
'content'
)
<
div
class
="
container
">
<div class="
row
">
<div class="
col
-
12
">
<h4 class="
mb
-
5
">
<span class="
text
-
top
-
title
">Список ваших адресов</span>
</h4>
</div>
<
div
class
="
container
">
<div class="
row
">
<div class="
col
-
12
">
<h4 class="
mb
-
5
">
<span class="
text
-
top
-
title
">Список ваших адресов</span>
</h4>
</div>
</div>
<div class="
row
">
<div class="
col
-
12
section
-
inset
-
1
">
<div class="
table
-
responsive
">
<table class="
table
table
-
hover
bg
-
white
border
-
1
shadow
-
sm
">
<thead>
<tr class="">
<th>#</th>
<th>ФИО</th>
<th>Паспорт</th>
<th>Адрес</th>
<th>Тел.</th>
<th>Опции</th>
</tr>
</thead>
<tbody>
@foreach(
$units
as
$i
=>
$unit
)
<div class="
row
">
<div class="
col
-
12
section
-
inset
-
1
">
<div class="
table
-
responsive
">
<table class="
table
table
-
hover
bg
-
white
border
-
1
shadow
-
sm
">
<thead>
<tr class="">
<th>#</th>
<th>ФИО</th>
<th>Паспорт</th>
<th>Адрес</th>
<th>Тел.</th>
<th>Тип</th>
<th>Опции</th>
</tr>
</thead>
<tbody>
@foreach(
$units
as
$i
=>
$unit
)
<tr>
<td>{{
$i
++ }}</td>
<td>{{
$unit->firstname
}} {{
$unit->lastname
}}</td>
...
...
@@ -37,23 +38,29 @@
{{
$unit->phone
}}
</td>
<td>
<a href="
/
address
/
{{
$unit
->
id
}}
/
edit
" class="
btn
btn
-
warning
btn
-
sm
mb
-
1
"> Редактировать</a>
{{ (
$unit->type
== 'recipient')?'Получатель':'Отправитель' }}
</td>
<td>
<a href="
/
address
/
{{
$unit
->
id
}}
/
edit
" class="
btn
btn
-
warning
btn
-
sm
mb
-
1
">
Редактировать</a>
<form action="
{{
route
(
'address.destroy'
,
$unit
->
id
)
}}
" method="
POST
">
@csrf
@method('DELETE')
<button type="
submit
" class="
btn
btn
-
danger
btn
-
sm
" ><i class="
fa
fa
-
times
-
circle
"></i> Удалить</button>
<button type="
submit
" class="
btn
btn
-
danger
btn
-
sm
"><i
class="
fa
fa
-
times
-
circle
"></i> Удалить
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- RD Mailform-->
<a class="
btn
btn
-
primary
shadow
" href="
{{
route
(
'address.add'
)
}}
" >Добавить адрес</a>
@endforeach
</tbody>
</table>
</div>
<!-- RD Mailform-->
<a class="
btn
btn
-
primary
shadow
" href="
{{
route
(
'address.add'
)
}}
">Добавить адрес</a>
</div>
</div>
</div>
@endsection
resources/views/pages/profile/user.blade.php
View file @
aeaeaab2
...
...
@@ -14,12 +14,9 @@
<div class="
col
-
4
">
<div class="
card
bg
-
white
border
-
primary
mb
-
3
">
<div class="
card
-
body
">
<h5 class="
card
-
title
">{{ Auth::user()->
lastname }} {{ Auth::user()->first
name }}</h5>
<h5 class="
card
-
title
">{{ Auth::user()->
name }} {{ Auth::user()->sur
name }}</h5>
<p class="
card
-
text
">
97 Quentin Road, <br />
ID {{ Auth::user()->id }}-FZ <br />
Brooklyn, NY 11234
(347) 547-9797
Код Клиента <b style="
font
-
size
:
16
px
">{{ Auth::user()->uni_code }}</b> <br/>
</p>
</div>
</div>
...
...
@@ -31,25 +28,31 @@
<div class="
col
-
xs
-
12
col
-
sm
-
6
form
-
group
">
<div class="
form
-
wrap
">
<label for="
forms
-
check
-
country1
">Имя</label>
<input class="
form
-
control
" id="
forms
-
check
-
country1
" value="
{{
Auth
::
user
()
->
firstname
}}
" type="
text
" name="
firstname
" data-constraints="
@
Required
">
<input class="
form
-
control
" id="
forms
-
check
-
country1
" value="
{{
Auth
::
user
()
->
name
}}
"
type="
text
" name="
name
" data-constraints="
@
Required
">
</div>
</div>
<div class="
col
-
xs
-
12
col
-
sm
-
6
form
-
group
">
<div class="
form
-
wrap
">
<label for="
forms
-
check
-
country1
">Фамилия</label>
<input class="
form
-
control
" id="
forms
-
check
-
country1
" value="
{{
Auth
::
user
()
->
lastname
}}
" type="
text
" name="
lastname
" data-constraints="
@
Required
">
<input class="
form
-
control
" id="
forms
-
check
-
country1
"
value="
{{
Auth
::
user
()
->
surname
}}
" type="
text
" name="
surname
"
data-constraints="
@
Required
">
</div>
</div>
<div class="
col
-
xs
-
12
col
-
sm
-
6
form
-
group
">
<div class="
form
-
wrap
">
<label for="
forms
-
check
-
postcode1
">Email</label>
<input class="
form
-
control
" id="
forms
-
check
-
postcode1
" type="
text
" name="
email
" value="
{{
Auth
::
user
()
->
email
}}
" data-constraints="
@
Required
">
<input class="
form
-
control
" id="
forms
-
check
-
postcode1
" type="
text
" name="
email
"
value="
{{
Auth
::
user
()
->
email
}}
" data-constraints="
@
Required
" disabled>
</div>
</div>
<div class="
col
-
xs
-
12
col
-
sm
-
6
form
-
group
">
<div class="
form
-
wrap
">
<label for="
forms
-
check
-
postcode1
">Телефон</label>
<input class="
form
-
control
" id="
forms
-
check
-
postcode1
" type="
text
" name="
phone
" value="
{{
Auth
::
user
()
->
phone
}}
" placeholder="
Phone
...
" data-constraints="
@
Required
">
<input class="
form
-
control
" id="
forms
-
check
-
postcode1
" type="
text
" name="
phone
"
value="
{{
Auth
::
user
()
->
phone
}}
" placeholder="
Phone
...
"
data-constraints="
@
Required
">
</div>
</div>
<div class="
col
-
xs
-
12
col
-
sm
-
6
form
-
group
">
...
...
@@ -61,12 +64,13 @@
<div class="
col
-
xs
-
12
col
-
sm
-
6
form
-
group
">
<div class="
form
-
wrap
">
<label for="
password_confirmation
">Подтверждение пароля</label>
<input class="
form
-
control
" id="
password_confirmation
" type="
password
" name="
password_confirmation
">
<input class="
form
-
control
" id="
password_confirmation
" type="
password
"
name="
password_confirmation
">
</div>
</div>
</div>
<br
/><br
/>
<br
/><br
/>
<button class="
btn
btn
-
primary
btn
-
xs
">Сохранить</button>
</form>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment