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:
5555- Full text searching
5656- Pagination
5757- Multi delete users
58-
58+ - Inertia.ks progress indicator
59+ - Font Awesome icons
60+ - Application analytics
61+ - User default profile avatar
5962## Contributing
6063
6164If 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)
1818 {
1919 return Inertia::render ('Users/Index ' , [
2020 '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 . '% ' );
2223 })->latest ()->paginate (5 ),
2324 ]);
2425 }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public function rules(): array
2323 {
2424 return [
2525 'name ' => 'required|min:2|max:255 ' ,
26+ 'description ' => 'required|min:2|max:255 ' ,
2627 'email ' => 'required|email|min:2|max:255|unique:users ' ,
2728 'password ' => 'required|min:8|max:255 ' ,
2829 'role_id ' => 'required ' ,
Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ public function up(): void
1616 $ table ->id ();
1717 $ table ->string ('name ' );
1818 $ table ->string ('email ' )->unique ();
19+ $ table ->string ('description ' )->default ('placeholder ' );
1920 $ table ->string ('avatar ' )->default ('placeholder ' );
2021 $ table ->timestamp ('email_verified_at ' )->nullable ();
2122 $ table ->string ('password ' );
2223 $ table ->rememberToken ();
2324 $ table ->foreignId ('current_team_id ' )->nullable ();
24- $ table ->bigInteger ('role_id ' )->unsigned ()->index ()->nullable ( );
25+ $ table ->bigInteger ('role_id ' )->unsigned ()->index ()->default ( 2 );
2526 // $table->foreign('role_id')->references('id')->on('roles')->cascadeOnDelete();
2627 $ table ->timestamps ();
2728 });
Original file line number Diff line number Diff line change 2424 <span class =" text-red-500" >{{ errors.name }}</span >
2525 </div >
2626
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+
2737 <div class =" mb-4" >
2838 <label class =" block mb-2 text-sm font-bold text-gray-700" for =" email" >
2939 E-mail <span class =" text-red-500" >*</span >
7787 </AppLayout >
7888</template >
7989
80-
8190<script >
8291import AppLayout from ' @/Layouts/AppLayout.vue' ;
8392import Button from ' @/Components/Button.vue' ;
@@ -97,7 +106,8 @@ export default {
97106 email: ' ' ,
98107 role_id: 2 ,
99108 password: ' ' ,
100- avatar: null
109+ avatar: null ,
110+ description: ' '
101111 })
102112 }
103113 },
Original file line number Diff line number Diff line change 1414 <hr class =" my-4" >
1515 <div class =" my-2" >
1616 <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 >
1822 </div >
1923 </div >
2024 </div >
@@ -27,7 +31,7 @@ import AppLayout from '@/Layouts/AppLayout.vue';
2731
2832export default {
2933 components: {
30- AppLayout
34+ AppLayout,
3135 },
3236 props: {
3337 getUser: Object ,
You can’t perform that action at this time.
0 commit comments