source: resources/views/dashboard/users/create.blade.php@ 6b95845

develop
Last change on this file since 6b95845 was d795fa6, checked in by Berat Kjufliju <kufliju@…>, 3 years ago

added validation to blades

  • Property mode set to 100644
File size: 7.4 KB
RevLine 
[194a359]1@extends('layouts.app')
2
3@section("title", "Users - Create new")
4
5@section('pageTitle', 'Create user')
6
7@section('content')
8
9 <div class="page-header">
10 <nav aria-label="breadcrumb" class="d-flex align-items-start">
11 <ol class="breadcrumb">
12 <li class="breadcrumb-item">
13 <a href="{{ url('dashboard/users') }}">Users</a>
14 </li>
15 <li class="breadcrumb-item active" aria-current="page">Create user</li>
16 </ol>
17 </nav>
18 </div>
19
20 <div class="row">
21 <div class="col-md-12">
22
23 <div class="row">
24 <div class="col-lg-12 col-md-12">
25 <div class="tab-content" id="v-pills-tabContent">
26 <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
27 <div class="card">
28 <div class="card-body">
[d795fa6]29 <h6 class="card-title">Create user</h6>
30 <form action="{{ route("dashboard.users.store") }}" method="post" accept-charset="utf-8" enctype='multipart/form-data' class="needs-validation" novalidate>
[194a359]31 @csrf
32 <div class="row">
33 <div class="col-md-6">
34 <div class="form-group">
35 <label>Name</label>
[d795fa6]36 <input type="text" name="name" value="{{ old('name') }}" minlength="2" maxlength="25" pattern="[a-zA-Zа-шА-Ш._\s]+" class="form-control" placeholder="Name" required>
37 <div class="invalid-feedback">
38 Please enter only letters and spaces with length between [2, 25]
39 </div>
[194a359]40 </div>
41 </div>
42 <div class="col-md-6">
43 <div class="form-group">
44 <label>Surname</label>
[d795fa6]45 <input type="text" name="surname" value="{{ old('surname') }}" minlength="2" maxlength="25" pattern="[a-zA-Zа-шА-Ш._\s]+" class="form-control" placeholder="Surname" required>
46 <div class="invalid-feedback">
47 Please enter only letters and spaces with length between [2, 25]
48 </div>
[194a359]49 </div>
50 </div>
51 </div>
52 <div class="row">
53 <div class="col-md-6">
54 <div class="form-group">
55 <label class="form-label">Username</label>
[d795fa6]56 <input type="text" name="username" value="{{ old('username') }}" minlength="5" maxlength="30" class="form-control" placeholder="Username" required>
57 <div class="invalid-feedback">
58 Please enter characters with length between [5, 30]
59 </div>
[194a359]60 </div>
61 </div>
62 <div class="col-md-6">
63 <div class="form-group">
64 <label class="form-label">Role</label>
[d795fa6]65 <select class="form-control" name="userRole required">
[194a359]66 @foreach ($roles as $role)
[d795fa6]67 <option value="{{ $role->id }}" {{ (old("userRole") == $role->id ? "selected" : "" ) }}>{{ $role->name }}</option>
[194a359]68 @endforeach
69 </select>
70 </div>
71 </div>
72 </div>
73 <div class="row">
74 <div class="col-md-6">
75 <div class="form-group">
76 <label>Email</label>
77 <input type="email" name="email" value="{{ old('email') }}" class="form-control" placeholder="E-mail" required>
[d795fa6]78 <div class="invalid-feedback">
79 Please enter a valid email address
80 </div>
[194a359]81 </div>
82 </div>
83 <div class="col-md-6">
84 <div class="form-group">
[d795fa6]85 <label class="form-label">Phone Number</label>
86 <input type="text" name="phone_number" value="{{ old('phone_number') }}" class="form-control" placeholder="Phone number" autocomplete="off" required>
87 <div class="invalid-feedback">
88 Please enter your phone number
89 </div>
[194a359]90 </div>
91 </div>
92
[24a616f]93 </div>
94
95 <div class="row">
96 <div class="col-md-6">
97 <div class="form-group">
98 <label>Avatar</label>
99 <input type="file" name="avatar" value="{{ old('avatar') }}" class="form-control" accept="image/*">
[d795fa6]100 <div class="invalid-feedback">
101 Please upload a valid image file
102 </div>
[24a616f]103 </div>
104 </div>
[194a359]105 </div>
106 <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10">
107 </form>
108 </div>
109 </div>
110 </div>
111 </div>
112 </div>
113 </div>
114 </div>
115 </div>
116
117@endsection
Note: See TracBrowser for help on using the repository browser.