File tree Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ This application includes the following features:
55
55
- Full text searching
56
56
- Pagination
57
57
- Multi delete users
58
-
58
+ - Inertia.ks progress indicator
59
+ - Font Awesome icons
60
+ - Application analytics
61
+ - User default profile avatar
59
62
## Contributing
60
63
61
64
If you would like to contribute to this project, please follow these steps:
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ public function index(Request $request)
18
18
{
19
19
return Inertia::render ('Users/Index ' , [
20
20
'users ' => User::with ('role ' )->when ($ request ->term , function ($ query , $ term ) {
21
- $ query ->where ('name ' , 'LIKE ' , '% ' . $ term . '% ' );
21
+ $ query ->where ('name ' , 'LIKE ' , '% ' . $ term . '% ' )
22
+ ->orWhere ('email ' , 'LIKE ' , '% ' . $ term . '% ' );
22
23
})->latest ()->paginate (5 ),
23
24
]);
24
25
}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public function rules(): array
23
23
{
24
24
return [
25
25
'name ' => 'required|min:2|max:255 ' ,
26
+ 'description ' => 'required|min:2|max:255 ' ,
26
27
'email ' => 'required|email|min:2|max:255|unique:users ' ,
27
28
'password ' => 'required|min:8|max:255 ' ,
28
29
'role_id ' => 'required ' ,
Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ public function up(): void
16
16
$ table ->id ();
17
17
$ table ->string ('name ' );
18
18
$ table ->string ('email ' )->unique ();
19
+ $ table ->string ('description ' )->default ('placeholder ' );
19
20
$ table ->string ('avatar ' )->default ('placeholder ' );
20
21
$ table ->timestamp ('email_verified_at ' )->nullable ();
21
22
$ table ->string ('password ' );
22
23
$ table ->rememberToken ();
23
24
$ table ->foreignId ('current_team_id ' )->nullable ();
24
- $ table ->bigInteger ('role_id ' )->unsigned ()->index ()->nullable ( );
25
+ $ table ->bigInteger ('role_id ' )->unsigned ()->index ()->default ( 2 );
25
26
// $table->foreign('role_id')->references('id')->on('roles')->cascadeOnDelete();
26
27
$ table ->timestamps ();
27
28
});
Original file line number Diff line number Diff line change 24
24
<span class =" text-red-500" >{{ errors.name }}</span >
25
25
</div >
26
26
27
+ <div class =" mb-4" >
28
+ <label class =" block mb-2 text-sm font-bold text-gray-700" for =" name" >
29
+ Description <span class =" text-red-500" >*</span >
30
+ </label >
31
+ <input v-model =" form.description"
32
+ class =" w-full px-3 py-2 mb-2 leading-tight text-gray-700 border rounded shadow appearance-none focus:outline-none focus:shadow-outline"
33
+ id =" description" type =" text" >
34
+ <span class =" text-red-500" >{{ errors.description }}</span >
35
+ </div >
36
+
27
37
<div class =" mb-4" >
28
38
<label class =" block mb-2 text-sm font-bold text-gray-700" for =" email" >
29
39
E-mail <span class =" text-red-500" >*</span >
77
87
</AppLayout >
78
88
</template >
79
89
80
-
81
90
<script >
82
91
import AppLayout from ' @/Layouts/AppLayout.vue' ;
83
92
import Button from ' @/Components/Button.vue' ;
@@ -97,7 +106,8 @@ export default {
97
106
email: ' ' ,
98
107
role_id: 2 ,
99
108
password: ' ' ,
100
- avatar: null
109
+ avatar: null ,
110
+ description: ' '
101
111
})
102
112
}
103
113
},
Original file line number Diff line number Diff line change 14
14
<hr class =" my-4" >
15
15
<div class =" my-2" >
16
16
<h2 class =" text-sm font-bold text-gray-600 uppercase" >About</h2 >
17
- <p class =" mt-2 text-gray-600" >{{ user.about }}</p >
17
+ <p class =" mt-2 text-gray-600" >{{ getUser.description != 'placeholder'
18
+ ? getUser.description
19
+ : 'No data available.'
20
+ }}
21
+ </p >
18
22
</div >
19
23
</div >
20
24
</div >
@@ -27,7 +31,7 @@ import AppLayout from '@/Layouts/AppLayout.vue';
27
31
28
32
export default {
29
33
components: {
30
- AppLayout
34
+ AppLayout,
31
35
},
32
36
props: {
33
37
getUser: Object ,
You can’t perform that action at this time.
0 commit comments