One Hat Cyber Team
Your IP :
216.73.216.84
Server IP :
50.6.229.107
Server :
Linux server.hostburly.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.2.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
andjemzt
/
View File Name :
.bash_history
cd niqs_api #1765124730 php artisan optimize:clear #1765125094 php artisan route:clear #1765125115 php artisan config:clear #1765132461 php artisan optimize:clear #1765193806 cd niqs_api #1765193815 php artisan route:list #1765297454 cd niqs_api #1765297459 php artisan migrate #1765697897 cd niqs_api #1765697906 php artisan optimize:clear #1765698406 php artisan make:migration create_assessors_table #1765698722 php artisan make:migration create_assessors_table -mc #1765698739 php artisan make:migration create_assessors_table-mc #1765698751 php artisan make:migration create_assessors_table mc #1765698948 php artisan make:model Assessor -mc #1765702774 cd niqs_api #1765702775 php artisan make:migration create_assessor_diets_table #1765704156 cd niqs_api #1765704160 php artisan make:service AssessorAssignmentService #1765705334 cd niqs_api #1765705341 php artisan migrate #1765891961 cd niqs_api #1765891987 php artisan make:seeder RolePermissionSeeder #1765892676 php artisan db:seed --class=RolePermissionSeeder #1766146354 ls #1766146381 cd niqs_api #1766146386 ls #1766146513 php artisan make:model Chapter -mc #1766146601 php artisan make:model ChapterDiet -mc #1766147296 php artisan make:model ChapterLeadership -mc #1766148108 php artisan make:controller Api/ChapterController #1766148310 php artisan make:controller Api/Chapter/ChapterController #1766148330 php artisan make:controller Api/Chapter/ChapterLeadershipController #1766148346 php artisan make:controller Api/Chapter/ChapterDietController #1766470488 cd niqs_api #1766470489 ls #1766471823 php artisan migrate #1766472813 php artisan migrate #1766473055 use HasFactory, HasUuids,SoftDeletes; #1766473081 php artisan migrate:rollback #1766473183 php artisan migrate #1766473250 php artisan migrate:rollback #1766473259 php artisan migrate #1766473333 php artisan migrate:rollback #1766473357 php artisan migrate #1767256199 ls #1767256219 cd niqs_api #1767256234 php artisan optimize:clear #1767256235 php artisan config:clear #1767256235 php artisan route:clear #1767256412 php artisan make:middleware CorsMiddleware #1767256452 php artisan make:middleware CorsMiddleware #1767256624 php artisan optimize:clear #1767256624 php artisan route:clear #1767256625 php artisan config:clear #1767257380 php artisan optimize:clear #1767257882 php artisan route:list #1767258350 php artisan vendor:publish --tag=cors #1767258506 php artisan config:clear #1767258507 php artisan cache:clear #1767258507 php artisan route:clear #1767258507 php artisan optimize:clear #1767258879 curl -X POST https://api.andjemztech.com/api/auth/login -H "Content-Type: application/json" -d '{"email":"your-email@example.com","password":"your-password"}' #1767259045 curl -i https://api.andjemztech.com/api/health #1767259288 php artisan config:clear #1767259288 php artisan route:clear #1767259289 php artisan cache:clear #1767259428 curl -i https://api.andjemztech.com/api/health #1767260177 curl -i -X POST https://api.andjemztech.com/api/auth/login -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email":"your-email@example.com","password":"your-password"}' #1767260205 curl -i -X POST https://api.andjemztech.com/api/auth/login -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email":"your-email@example.com","password":"your-password"}' #1767260222 curl -i -X POST https://api.andjemztech.com/api/auth/login -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email":"your-email@example.com","password":"your-password"}' #1767260505 curl -i -X POST https://api.andjemztech.com/api/auth/login -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email":"your-email@example.com","password":"your-password"}' #1767260946 php artisan optimize:clear #1767260976 curl -i -X POST https://api.andjemztech.com/api/auth/login -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email":"your-email@example.com","password":"your-password"}' #1767261402 php artisan optimize:clear #1767261513 fetch('https://api.andjemztech.com/api/health', { method: 'GET' }) #1767261513 .then(res => res.json()) #1767261513 .then(console.log) #1767261513 .catch(console.error); #1767261568 curl -i https://api.andjemztech.com/api/health #1767261869 curl -i https://api.andjemztech.com/api/health #1767262000 curl -i -X OPTIONS https://api.andjemztech.com/api/auth/login -H "Origin: http://localhost:3000" -H "Access-Control-Request-Method: POST" -H "Access-Control-Request-Headers: Content-Type, Authorization" #1767262785 php artisan config:clear #1767262786 php artisan route:clear #1767262792 php artisan optimize:clear #1767263158 php artisan optimize:clear #1767263163 php artisan route:clear #1767263361 chmod -R 775 storage bootstrap/cache #1767269900 ls #1767269908 cd niqs_api #1767269913 php artisan optimize:clear #1767270528 php artisan optimize:clear #1767270529 php artisan view:clear #1767270529 php artisan config:clear #1767270532 composer dump-autoload #1767272451 cd niqs_api #1767272467 php artisan optimize:clear #1767273031 php artisan config:publish cors #1767273248 php artisan config:clear #1767273248 php artisan cache:clear #1767273248 php artisan optimize:clear #1767274694 cd niqs_api #1767274699 artisan optimize:clear #1767274734 php artisan optimize:clear #1767275121 php artisan optimize:clear #1767275121 php artisan config:clear #1767275122 php artisan route:clear #1767275122 php artisan cache:clear #1767275433 php artisan config:clear #1767275433 php artisan cache:clear #1767275434 php artisan optimize:clear #1767275443 sudo service php8.x-fpm restart #1767275443 sudo service nginx restart #1767275443 # or apache2 restart if applicable #1767276106 php artisan optimize:clear #1767276107 php artisan config:clear #1767276107 php artisan route:clear #1767276107 php artisan cache:clear #1767276119 php artisan serve #1767276363 fetch("https://api.andjemztech.com/api/health") #1767276363 .then(r => r.json()) #1767276363 .then(console.log) #1767276363 .catch(console.error); #1767698332 cd niqs_api #1767698343 php artisan migration:status #1767698356 php artisan migrate:status #1767699699 php artisan migrate #1767700023 php artisan migrate #1767700635 php artisan storage:link #1767701512 php artisan storage:link #1767701547 php artisan storage:link --relative #1767701863 php artisan storage:link #1767702282 ls -la public | grep storage #1767702344 echo "OK" > public/hello.txt #1767702693 echo OK > public/hello.txt #1767703700 cd ~/api.andjemztech.com # or wherever the subdomain root is #1767703700 rm -rf storage #1767703700 ln -s /home1/andjemzt/niqs_api/storage/app/public storage #1767703977 https://api.andjemztech.com/storage/profile_photos/YQT3Ze6COfcoFRSEKWm3wLHEZaHu4mQ9qXmG79LP.jpg #1767703978 ls -lah storage/app/public/profile_photos/YQT3Ze6COfcoFRSEKWm3wLHEZaHu4mQ9qXmG79LP.jpg #1767704006 ls #1767704012 cd .. #1767704018 ls #1767704024 cd niqs_api #1767704025 andjemzt@andjemztech.com [~/api.andjemztech.com]# ls -lah storage/app/public/profile_photos/YQT3Ze6COfcoFRSEKWm3wLHEZaHu4mQ9qXmG79LP.jpg #1767704025 /bin/ls: cannot access storage/app/public/profile_photos/YQT3Ze6COfcoFRSEKWm3wLHEZaHu4mQ9qXmG79LP.jpg: No such file or directory #1767704114 andjemzt@andjemztech.com [~/api.andjemztech.com]# cd ../niqs_api #1767704116 ls -lah storage/app/public #1767704116 ls -lah storage/app/public/profile_photos 2>/dev/null || echo "profile_photos folder missing" #1767704116 find storage/app/public -maxdepth 2 -type f | head -n 30 #1767704243 cd ~/api.andjemztech.com #1767704243 ls -la | grep storage #1767704259 ls -la storage | head #1767704259 ls -lah storage/profile_photos | head #1768174415 ls #1768174427 cd ggh_api #1768174429 composer install --optimize-autoloader --no-dev #1768174429 php artisan config:cache #1768174445 php artisan route:cache #1768174842 php artisan migrate #1768174907 /opt/cpanel/ea-php84/root/usr/bin/php artisan migrate #1768175072 rm composer.lock #1768175094 rm -rf vendor #1768175104 composer install #1768175124 php artisan migrate #1768175905 php artisan key:generate #1768176134 composer dump-autoload #1768176138 php artisan config:clear #1768176421 php artisan route:clear #1768176427 php artisan permission:create-role admin api #1768656640 ls #1768656649 cd niqs_api #1768656650 ls #1768656711 php artisan make:migration create_user_categories_table #1768656924 php artisan migrate #1768656928 php artisan migrate #1768657120 php artisan make:seeder UserCategorySeeder #1768657438 php artisan db:seed --class=UserCategorySeeder #1768657631 php artisan make:migration create_membership_bands_table #1768658116 php artisan make:migration add_membership_fields_to_users_table --table=users #1768658966 php artisan migrate #1768659079 php artisan make:migration create_charge_types_table #1768659234 php artisan make:migration create_charge_prices_table #1768659360 php artisan make:migration create_payments_table #1768659474 php artisan migrate #1768660851 php artisan migrate:rollback #1768660851 php artisan migrate #1768660859 cd niqs_api #1768660860 php artisan migrate:rollback #1768661532 php artisan migrate #1768827537 ls #1768827547 cd ggh_api #1768827548 ls #1768827586 php artisan make:migration create_kycs_table #1768827845 php artisan make:migration create_kyc_documents_table #1768845166 cd ggh_api #1768845171 php artisan migrate #1768846319 php artisan config:clear #1768846320 php artisan cache:clear #1768846460 php artisan config:clear #1768846460 php artisan cache:clear #1768849204 php artisan route:list --path=kyc #1768849442 php artisan route:list --path=kyc #1768892650 ls #1768892686 cd ggh_api #1768892769 php artisan make:migration create_password_reset_otps_table #1768893233 php artisan migrate #1768893278 php artisan migrate #1768930509 ls #1768930523 cd ggh_api #1768930525 ls #1768930527 php artisan route:list --path=password #1768933017 cd ggh_api #1768933018 php artisan route:list --path=admins #1768933285 php artisan optimize:clear #1768934055 curl -i -X POST "https://ggh.andjemztech.com/api/admins" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer 9|pXpEHLpnHX0rT94l3oH1NF6Iew15jAGtRp1vcQl90cfce7a4" -d '{ "email": "admin3@company.com", "staff_no": "STF-1001", "first_name": "Ada", "last_name": "Okoro", "phone": "08012345678", "gender": "Female", "department": "Academics", "job_title": "Content Manager", "status": "Active" }' #1768992026 cd ggh_api #1768992027 php artisan make:migration create_categories_table #1768992028 php artisan make:migration create_category_course_table #1768992029 php artisan make:model Category #1768992029 php artisan make:controller Api/Lms/CategoryController --api #1768992029 php artisan make:request Lms/CategoryStoreRequest #1768992030 php artisan make:request Lms/CategoryUpdateRequest #1768992030 php artisan make:resource CategoryResource #1768992352 php artisan migrate #1768992358 php artisan migrate #1768994858 cd ggh_api #1768994860 php artisan make:controller Api/Lms/Category/CategoryTreeController #1768994861 php artisan make:controller Api/Lms/Category/CategoryCourseController #1768994861 php artisan make:request Lms/Category/CategoryCourseAttachRequest #1768994862 php artisan make:request Lms/Category/CategoryCourseSyncRequest #1769012806 cd ggh_api #1769012807 php artisan make:request Lms/Course/CourseStoreRequest #1769012808 php artisan make:request Lms/Course/CourseUpdateRequest #1769012812 php artisan make:resource CourseResource #1769081213 cd ggh_api #1769081215 php artisan storage:link #1769081462 php artisan storage:link #1769081695 cd ../ggh.andjemztech.com #1769081696 ls #1769081705 cd public #1769081721 php artisan storage:link #1769081733 cd .. #1769081735 php artisan storage:link #1769081951 ln -s /home/andjemzt/ggh_api/storage/app/public /home/andjemzt/ggh.andjemztech.com/storage #1769082106 �php artisan storage:link #1769082125 cd ../ggh_api #1769082127 php artisan storage:link #1769087072 cd ggh_api #1769087080 php artisan migrate #1769100661 cd ggh_api #1769100663 ls #1769100664 php artisan make:migration create_course_certificate_price_changes_table #1769101402 php artisan make:controller Api/Lms/CourseCertificatePriceController #1769102902 php artisan migrate #1769106272 cd ggh_api #1769106274 use App\Http\Controllers\Api\Lms\PublicCourseController; #1769106274 Route::prefix('v1/public')->group(function () { #1769106274 Route::get('courses', [PublicCourseController::class, 'index']); // list published #1769106274 Route::get('courses/{slug}', [PublicCourseController::class, 'show']); // details by slug #1769106274 Route::get('featured-courses', [PublicCourseController::class, 'featured']); // featured published #1769106274 }); #1769106301 php artisan make:controller Api/Lms/PublicCourseController #1769163079 ls #1769163092 cd ggh_api #1769163118 php artisan make resourse:CourseModuleResource #1769163163 php artisan make:resourse CourseModuleResource #1769163248 php artisan make:resource CourseModuleResource #1769163451 php artisan make:observer CourseModuleObserver #1769163610 php artisan make:controller Api/Lms/CourseModuleController #1769372257 cd ggh_api #1769372273 php artisan config:cache #1769372416 php artisan queue:restart #1769372571 php artisan config:cache #1769372584 php artisan queue:restart #1769502752 cd niqs_api #1769502753 php artisan route:clear #1769502754 php artisan cache:clear #1770092709 ls #1770092713 cd ggh_api #1770092715 ls #1770092722 php artisan migrate #1770093438 ld #1770093443 ls #1770093447 php artisan migrate #1770093827 DROP TABLE IF EXISTS coursesss; #1770094034 php artisan migrate #1770094104 php artisan migrate #1770094155 php artisan migrate #1770094443 php artisan optimize:clear #1770094884 php artisan migrate #1770162100 cd niqs_api #1770162102 ls #1770162112 php artisan make:model NecOffice -m #1770162200 php artisan make:controller Api/Nec/NecOfficeController --api #1770162349 php artisan migrate #1770163067 php artisan migrate #1770163069 php artisan migrate #1770197082 cd niqs_api #1770197084 php artisan make:model Nec -m #1770197085 php artisan make:controller Api/Nec/NecController #1770197256 php artisan migrate #1770360907 cd niqs_api #1770360934 ls #1770361136 php artisan make:model Exam -m #1770361163 php artisan make:model ExamDiet #1770361182 php artisan make:model ExamDiet -m #1770361211 php artisan make:model ExamCenter -m #1770361238 php artisan make:model ExamCenterSlot -m #1770361265 php artisan make:model ExamApplication -m #1770361308 php artisan make:model ExamApplicationPaper -m #1770362601 php artisan make:model ExamPaper -m #1770374546 cd niqs_api #1770374586 php artisan migrate #1770375244 php artisan migrate:rollback #1770377102 php artisan make:controller Exam/<?php #1770377102 namespace App\Http\Controllers\Api\Exam; #1770377102 use App\Http\Controllers\Controller; #1770377102 use App\Models\Exam; #1770377102 use Illuminate\Http\Request; #1770377102 use Illuminate\Validation\Rule; #1770377102 use Illuminate\Support\Str; #1770377102 class AdminExamController extends Controller #1770377102 { public function index() #1770377102 { return Exam::query() #1770377102 ->withCount('papers') #1770377102 ->orderBy('title') #1770377102 ->get(); #1770377102 } #1770377102 public function store(Request $request) #1770377102 { $data = $request->validate([ #1770377102 'code' => ['required','string','max:50','alpha_dash', 'unique:exams,code'], #1770377102 'title' => ['required','string','max:200'], #1770377102 'exam_type' => ['required', Rule::in(['type1','type2','type3','type4'])], #1770377102 'requires_logbook_stage' => ['required', Rule::in(['none','stage1','stage2'])], #1770377102 'has_multiple_papers' => ['nullable','boolean'], #1770377102 'is_active' => ['nullable','boolean'], #1770377102 ]); #1770377102 $exam = new Exam(); #1770377102 $exam->id = (string) Str::uuid(); #1770377102 $exam->fill([ #1770377102 'code' => $data['code'], #1770377102 'title' => $data['title'], #1770377102 'exam_type' => $data['exam_type'], #1770377102 'requires_logbook_stage' => $data['requires_logbook_stage'], #1770377102 'has_multiple_papers' => (bool) ($data['has_multiple_papers'] ?? false), #1770377102 'is_active' => (bool) ($data['is_active'] ?? true), #1770377102 ]); #1770377102 $exam->save(); #1770377102 return response()->json($exam, 201); #1770377102 } #1770377102 public function show(string $id) #1770377102 { $exam = Exam::with('papers')->findOrFail($id); #1770377102 return $exam; #1770377102 } #1770377102 public function update(Request $request, string $id) #1770377102 { $exam = Exam::findOrFail($id); #1770377102 $data = $request->validate([ #1770377102 'code' => ['sometimes','string','max:50','alpha_dash', Rule::unique('exams','code')->ignore($exam->id)], #1770377102 'title' => ['sometimes','string','max:200'], #1770377102 'exam_type' => ['sometimes', Rule::in(['type1','type2','type3','type4'])], #1770377102 'requires_logbook_stage' => ['sometimes', Rule::in(['none','stage1','stage2'])], #1770377102 'has_multiple_papers' => ['sometimes','boolean'], #1770377102 'is_active' => ['sometimes','boolean'], #1770377102 ]); #1770377102 $exam->fill($data); #1770377102 $exam->save(); #1770377102 return $exam; #1770377102 } #1770377102 public function destroy(string $id) #1770377102 { $exam = Exam::findOrFail($id); #1770377102 $exam->delete(); #1770377102 return response()->json(['message' => 'Exam deleted.']); #1770377102 } #1770377102 } #1770377114 ->withCount('papers') #1770377150 php artisan make:controller Api/Exam/AdminExamController #1770446724 cd niqs_apii #1770446734 cd niqs_api #1770446746 php artisan migrate #1770447041 php artisan migrate:rollback #1770447180 php artisan migrate #1770573977 ls #1770573997 cd ggh_Api #1770574005 cd ggh_api #1770574008 ls #1770574061 php artisan make migration: course_tutors #1770574121 php artisan make:migration course_tutors #1770574358 cd ggh_api #1770574391 php artisan make:model CourseTutor #1770574435 php artisan make:model CourseTutor -m #1770584203 cd ggh_api #1770584213 php artisan migrate #1770592752 php artisan migrate #1770627837 cd ggh_api #1770627849 php artisan migrate #1770706197 cd ggh_api #1770706224 php artisan make:model Entitlement -m #1770709171 php artisan make:model LessonCompletion -m #1770709456 php artisan make:service CourseAccessService #1770709779 php artisan make:middleware EnsureCourseAccess #1770805919 ls #1770805932 cd ggh_api #1770805936 ls #1770805954 php artisan make:controller Payment/PaymentController #1770805972 php artisan make:controller Api/Payment/PaymentController #1770806066 php artisan make:controller Api/Payments/PaymentController #1770806241 php artisan make:controller Api/Payments/WebhookController #1771045404 cd niqs_api #1771045453 php artisan make:migration create_states_table #1771045548 php artisan make:migration create_local_governments_table #1771045639 php artisan make:model State #1771045715 php artisan make:model LocalGovernment #1771047378 php artisan make:controller Api/LocationController #1771047811 php artisan migrate #1771048158 php artisan db:seed --class=Database\\Seeders\\NigeriaStatesLgasSeeder #1771048161 php artisan db:seed --class=Database\\Seeders\\NigeriaStatesLgasSeeder #1771048163 php artisan db:seed --class=Database\\Seeders\\NigeriaStatesLgasSeeder #1771048165 php artisan db:seed --class=Database\\Seeders\\NigeriaStatesLgasSeeder #1771048781 php artisan make:migration update_members_profile_fields #1771050721 php artisan migrate #1771056996 cd niqs_api #1771056998 php artisan make:command ImportOldMembers #1771068819 cd niqs_api #1771068821 php artisan db:seed --class=ChapterSeeder #1771072672 cd niqs_api #1771072673 php artisan import:members-old #1771072994 php artisan make:migration add_security_flags_to_users_table #1771073004 php artisan make:migration add_security_flags_to_users_table #1771074664 cd niqs_api #1771074665 php artisan import:members-old --chunk=500 #1771074702 php artisan import:members-old #1771074720 php artisan import:members-old #1771074723 php artisan import:members-old #1771074729 php artisan import:members-old #1771075326 cd niqs_api #1771075329 php artisan import:members-old --chunk=500 #1771075736 cd niqs_api #1771075751 php artisan import:members-old --chunk=500 #1771077350 cd niqs_api #1771077368 php artisan import:members-old --chunk=500 #1771078335 cd niqs_api #1771078337 php artisan import:members-old --chunk=500 #1771079008 php artisan optimize:clear #1771079009 php artisan config:clear #1771079009 php artisan cache:clear #1771079196 cd niqs_api #1771079200 php artisan optimize:clear #1771079200 php artisan config:clear #1771079201 php artisan cache:clear #1771079225 php artisan import:members-old --chunk=500 #1771080406 cd niqs_api #1771080460 php artisan optimize:clear #1771080461 php artisan import:members-old --chunk=500 #1771085430 cd niqs_api #1771085432 php artisan import:members-old --chunk=100 #1771089984 php artisan tinker #1771090033 php artisan tinker #1771090103 php artisan tinker #1771090455 php -v #1771090624 php artisan import:members-old --help #1771090933 mysql -u root -p niqs_db -e "SELECT MAX(old_member_id) AS last_id FROM members;" #1771090967 mysql -u root -p niqs_db -e "SELECT MAX(old_member_id) AS last_id FROM members; " #1771091019 mysql -u root -p niqs_db -e "SELECT MAX(old_member_id) AS last_id FROM members; " #1771091070 mysql -u andjemzt_rankyakab -p andjemzt_api -e "SELECT MAX(old_member_id) AS last_id FROM members;" #1771091133 php artisan import:members-old --chunk=15 --from=12559 --no-progress #1771215038 cd ggh_api #1771215064 php artisan make:middleware EnsureCourseEntitled #1771218792 php artisan migrate #1771270000 cd ggh_api #1771270018 php artisan migrate #1771272973 php artisan route:list --path=lms/courses #1771313161 cd ggh_api #1771313178 php artisan make:model Organisation #1771313215 php artisan make:model Organisation -m #1771313279 php artisan make:model Organization -m #1771313290 php artisan make:model OrganizationUser -m #1771313314 php artisan make:model OrganizationInvitation -m #1771313346 php artisan make:model LearningPath -m #1771313379 php artisan make:model LearningPathItem -m #1771313420 php artisan make:model OrganizationAssignment -m #1771319247 cd ggh_api #1771319301 php artisan make:controller Api/Org/OrganizationAdminController #1771319430 php artisan make:controller Api/Org/OrganizationInvitationController #1771319560 php artisan make:controller Api/Org/OrganizationAssignmentController #1771320722 php artisan migrate #1771325206 php artisan make:mail OrganizationInviteMail #1771374469 cd ggh_api #1771374471 php artisan queue:table #1771374472 php artisan migrate #1771396776 cd ggh_api #1771396798 php artisan make:controller Api/Org/LearningPathAdminController #1771396905 php artisan make:controller Api/Org/LearningPathItemAdminController #1771397300 php artisan make:controller Api/Org/OrganizationAssignmentController #1772036577 ls #1772036594 cd niqs_api #1772036606 php artisan config:clear #1772036606 php artisan cache:clear #1772036606 php artisan route:clear #1772036607 php artisan optimize:clear #1772041317 cd niqs_api #1772041319 php artisan optimize:clear #1772041319 php artisan config:clear #1772041320 php artisan route:clear #1772041320 php artisan cache:clear #1772042434 php artisan optimize:clear #1772042434 php artisan config:clear #1772042434 php artisan route:clear #1772042434 php artisan cache:clear #1772182496 ls #1772182506 cd ggh_api #1772182597 php artisan optimize:clear #1772256850 cd gg_api #1772256857 cd ggh_api #1772256860 php artisan queue:table #1772256860 php artisan queue:failed-table #1772256860 php artisan migrate #1772256885 php artisan queue:work --tries=3 #1772257123 php artisan queue:table #1772257123 php artisan queue:failed-table #1772257123 php artisan migrate #1772257134 php artisan queue:work --tries=3 #1772257279 php artisan queue:failed #1772257509 php artisan queue:failed:show 3687e4f2-f97f-4947-8f3c-bb78a21f4fb8 #1772257653 php artisan optimize:clear #1772257702 php artisan queue:restart #1772257703 php artisan queue:work #1772258508 php artisan queue:flush #1772258523 php artisan queue:restart #1772258524 php artisan queue:work #1772258643 php artisan queue:flush #1772259060 php artisan optimize:clear #1772259259 php artisan route:list | grep -i invite #1772259259 php artisan route:list | grep -i orgs #1772259259 php artisan route:list | grep -i invitations #1772259480 curl -i https://ggh.andjemztech.com/api/orgs #1772260569 hostname #1772260569 curl -I https://ggh.andjemztech.com #1772260626 dig +short ggh.andjemztech.com #1772260626 curl -4 -I https://ggh.andjemztech.com #1772260758 ls -la ~/ggh_api/public/index.php #1772260758 ls -la ~/ggh_api/public/.htaccess #1772261388 php artisan optimize:clear #1772261398 cd ggh_api #1772261402 php artisan optimize:clear #1772261786 find ~ -maxdepth 6 -type f -path "*/public/index.php" 2>/dev/null | head -n 20 #1772263387 ls -la /home/andjemzt/ggh_api/public/index.php #1772263714 .232 #1772263714 [andjemzt@server ~]$ ls -la /home/andjemzt/ggh_api/public/index.php #1772263714 ls: cannot access '/home/andjemzt/ggh_api/public/index.php': No such file or directory #1772263714 [andjemzt@server ~]$ #1772263720 .232 #1772263720 [andjemzt@server ~]$ ls -la /home/andjemzt/ggh_api/public/index.php #1772263720 ls: cannot access '/home/andjemzt/ggh_api/public/index.php': No such file or directory #1772263720 [andjemzt@server ~]$ #1772263777 ls -la /home/andjemzt/public_html/ggh.andjemztech.com/ggh_api/public/index.php #1772263807 ls -la /home/andjemzt/ggh_api/public/index.php #1772267167 cd ggh_api #1772267169 php artisan optimize:clear #1772267170 php artisan config:cache #1772267170 php artisan route:cache #1772267219 chmod -R 775 /home/andjemzt/ggh_api/storage /home/andjemzt/ggh_api/bootstrap/cache #1772267240 curl -i https://goodgov.andjemztech.com/ #1772267517 php artisan optimize:clear #1772267607 curl -i https://goodgov.andjemztech.com/api/health #1772267751 php artisan optimize:clear #1772403856 cd niqs_api #1772403880 php artisan migrate #1772448973 cd niqs_api #1772448980 php artisan config:clear #1772448981 php artisan cache:clear #1772451286 cd niqs_api #1772451296 php artisan optimize:clear #1772464509 cd niqs_api #1772464513 php artisan make:migration create_sectors_table #1772464582 php artisan make:model Sector #1772464839 php artisan migrate #1772476733 cd niqs_api #1772476740 php artisan optimize:clear #1772630620 cd niqs_api #1772630633 php artisan migrate #1772695486 cd niqs_api #1772695526 php artisan make:model Invoice -m #1772695558 php artisan make:model InvoiceItem -m #1772696361 php artisan make:model LedgerEntry -m #1772709473 cd niqs_api #1772709485 php artisan make:model Ledger -m #1772720199 cd niqs_api #1772720218 php artisan make:model LedgerAccount -m #1772720265 php artisan make:model LedgerTransaction -m #1772724699 cd niqs_api #1772724707 php artisan migrate #1772732014 cd niqs_api #1772732021 php artisan migrate #1773031619 cd niqs_api #1773031622 php artisan make:controller Api/Admin/MembershipDashboardController #1773067239 cd ggh_api #1773067241 php artisan queue:work #1773067278 php artisan queue:flush #1773067286 php artisan queue:work #1773067667 php artisan queue:flush #1773070215 cd niqs_api #1773070273 php artisan make:seeder LegacyDuesInvoiceSeeder #1773124007 cd ggh_api #1773124008 php artisan queue:flush #1773124051 php artisan queue:work #1773124272 # Delete all failed jobs so they stop retrying #1773124272 php artisan queue:flush #1773124272 # Clear the cache #1773124272 php artisan cache:clear #1773124444 # Delete all failed jobs so they stop retrying #1773124444 php artisan queue:flush #1773124444 # Clear the cache #1773124444 php artisan cache:clear #1773124570 cd ../ niqs_api #1773124580 cd ../niqs_api #1773126517 cd niqs_api #1773126963 ls #1774881172 cd ggh_api #1774881182 php artisan make:model Payment -m #1774881589 php artisan migrate #1774882581 php artisan make:controller Api/PaymentController #1774888974 cd ggh_api #1774888976 php artisan route:clear #1774888977 php artisan cache:clear #1774888977 php artisan config:clear #1774888977 php artisan optimize:clear #1774888998 php artisan route:list | grep payment.verify #1774889129 php artisan optimize:clear #1774889137 php artisan route:list | grep payment.verify #1774935093 cd ggh_api #1774935102 php artisan route:list | grep payment.verify #1774934709 cd ggh_api #1774934713 php artisan optimize:clear #1774934717 php artisan route:list | grep payment.verify #1774934726 php artisan route:list #1775102066 cd ggh_api #1775102068 php artisan config:clear #1775102196 php artisan cache:clear #1775104009 cd ggh_api #1775104012 php artisan optimize:clear #1775104561 php artisan config:clear #1775104561 php artisan cache:clear #1775108451 cd niqs_api #1775108464 php artisan optimize:clear #1775118383 cd ggh_api #1775118390 php artisan optimize:clear #1775118685 php artisan config:clear #1775118685 php artisan cache:clear #1775119254 php artisan config:clear #1775119258 php artisan cache:clear #1775119264 php artisan optimize:clear #1775129445 cd ggh_api #1775129450 php artisan optimize:clear #1775132832 cd ggh_api #1775132833 php artisan storage:link #1775132915 ls #1775132923 cd app #1775132926 ls #1775132937 cd .. #1775132939 mkdir -p storage/app/public #1775132939 php artisan storage:link #1775133913 ln -s /home/andjemzt/ggh_api/storage/app/public storage #1775133923 ls -la #1775134295 chmod -R 775 /home/andjemzt/ggh_api/storage #1775134295 chmod -R 775 /home/andjemzt/ggh_api/bootstrap/cache #1775134313 ls -la /home/andjemzt/goodgov.andjemztech.com/storage #1775134354 ln -s /home/andjemzt/ggh_api/storage/app/public /home/andjemzt/goodgov.andjemztech.com/storage #1775134361 ls -la /home/andjemzt/goodgov.andjemztech.com/storage #1775196075 cd niqs_api #1775196104 php artisan import:members-probationers --chunk=100 #1775197078 php artisan config:clear #1775197078 php artisan cache:clear #1775197466 php artisan list | grep import #1775197750 php artisan optimize:clear #1775197763 php artisan list | grep probationers #1775197915 php artisan optimize:clear #1775197932 composer dump-autoload #1775197945 php -l app/Console/Commands/ImportProbationerMembers.php #1775197982 ls -R app/Console/Commands #1775198071 php artisan make:command ImportProbationerMembers #1775198078 ls -R app/Console/Commands #1775198171 php artisan import:members-probationers --chunk=100 #1775198239 php artisan optimize:clear #1775198250 php artisan import:members-probationer --chunk=100 #1775198315 php artisan make:command ImportProbMembers #1775198369 ls -la --color=none app/Console/Commands/ #1775198715 cat << 'EOF' > app/Console/Commands/ImportProbMembers.php <?php namespace App\Console\Commands; use App\Models\User; use Illuminate\Console\Command; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; use Spatie\Permission\Models\Role; class ImportProbMembers extends Command { protected $signature = 'import:probationers {--chunk=100}'; protected $description = 'Import Grade 3 Probationers only'; public function handle(): int { @set_time_limit(0); @ini_set('memory_limit', '1024M'); DB::disableQueryLog(); Model::unsetEventDispatcher(); $chunk = max(10, (int) $this->option('chunk')); $from = max(1, (int) $this->option('from')); $noProgress = (bool) $this->option('no-progress'); if (!Schema::hasTable('members_old')) { $this->error('❌ members_old table not found.'); return self::FAILURE; } $guard = 'api'; $memberChapterIsUuid = $this->isUuidColumn('members', 'chapter_id'); // Filter by Grade 3 at the Database level for speed $query = DB::table('members_old') ->where('memberID', '>=', $from) ->where('memberGrade', 3); $total = $query->count(); $this->info("Found {$total} Probationer (Grade 3) records to process."); $stats = [ 'processed' => 0, 'imported' => 0, 'updated' => 0, 'users_created' => 0, 'users_updated' => 0, 'last_memberID' => null, 'zero_dates_nullified' => 0, ]; $roleIdCache = []; $emailSeenInRun = []; $bar = null; if (!$noProgress && $total > 0) { $bar = $this->output->createProgressBar($total); $bar->start(); } $query->orderBy('memberID') ->chunkById($chunk, function ($rows) use ( &$stats, $guard, $memberChapterIsUuid, &$roleIdCache, &$emailSeenInRun, $bar, $noProgress ) { foreach ($rows as $r) { $stats['processed']++; $stats['last_memberID'] = (int) $r->memberID; $oldId = (int) $r->memberID; $grade = 3; // We know it's 3 because of the query filter [$roleName, $whois] = $this->mapGradeToRoleAndWhois($grade); // Email Sanitization $email = $this->cleanEmail($r->memberEmail ?? null) ?: "probationer{$oldId}@niqs.org.ng"; $email = $this->ensureUniqueEmailFast($email, $oldId, $emailSeenInRun); $emailSeenInRun[$email] = true; $fullName = $this->buildFullName( (string)($r->memberSurname ?? ''), (string)($r->memberOthernames ?? ''), (string)($r->memberName ?? '') ); // User Management $user = User::where('email', $email)->first(); $code = (string) random_int(100000, 999999); if (!$user) { $user = User::create([ 'name' => $fullName, 'email' => $email, 'password' => bcrypt('niqs@probationer'), 'must_change_password' => true, 'email_verification_code' => $code, 'whois' => $whois, 'status' => 'active', ]); $stats['users_created']++; } else { $user->update(['whois' => $whois]); $stats['users_updated']++; } // Spatie Role Sync if (!isset($roleIdCache[$roleName])) { $role = Role::findOrCreate($roleName, $guard); $roleIdCache[$roleName] = $role->id; } $user->syncRoles([$roleName]); // Prepare Member Payload $genderCol = Schema::hasColumn('members', 'gender') ? 'gender' : 'sex'; $payload = [ 'user_id' => $user->id, 'old_member_id' => $oldId, 'membership_no' => $r->memberNo ?? null, 'surname' => $r->memberSurname ?? null, 'firstname' => $this->deriveFirstNameNullable((string)$r->memberOthernames, (string)$r->memberName), 'dob' => $this->safeDate($r->memberDOB ?? null, $stats), $genderCol => $r->memberSex ?? null, 'grade' => '3', 'reg_date' => $this->safeDate($r->memberRegDate ?? null, $stats), 'email' => $email, 'phone' => $r->memberPhone ?? null, 'updated_at' => now(), ]; // Insert or Update Member Record $existingMember = DB::table('members')->where('old_member_id', $oldId)->first(); if ($existingMember) { DB::table('members')->where('old_member_id', $oldId)->update($payload); $stats['updated']++; } else { $payload['id'] = (string) Str::uuid(); $payload['created_at'] = now(); DB::table('members')->insert($payload); $stats['imported']++; } if (!$noProgress) $bar?->advance(); } }, 'memberID', 'memberID'); if (!$noProgress && $total > 0) { $bar?->finish(); $this->newLine(); } $this->info('✅ Probationer Import Completed.'); $this->table(['Metric', 'Count'], [ ['Processed (Grade 3)', $stats['processed']], ['Users Created', $stats['users_created']], ['Members Linked/Updated', $stats['updated'] + $stats['imported']], ]); return self::SUCCESS; } // --- Helper Methods (Keep these from your original script) --- private function safeDate($value, array &$stats): ?string { if (!$value || in_array($value, ['0000-00-00', '0000-00-00 00:00:00'])) { $stats['zero_dates_nullified']++; return null; } try { return Carbon::parse($value)->toDateString(); } catch (\Exception $e) { return null; } } private function isUuidColumn($table, $column): bool { return true; // Simplification for your specific NIQS schema } private function cleanEmail(?string $email): ?string { $email = strtolower(trim((string)$email)); return filter_var($email, FILTER_VALIDATE_EMAIL) ? $email : null; } private function ensureUniqueEmailFast($email, $oldId, $seen): string { if (isset($seen[$email]) || User::where('email', $email)->exists()) { $parts = explode('@', $email); return $parts[0] . '.' . $oldId . '@' . ($parts[1] ?? 'niqs.org.ng'); } return $email; } private function buildFullName($surname, $other, $name): string { return trim("$surname $other") ?: (trim($name) ?: 'NIQS Member'); } private function deriveFirstNameNullable($other, $name): ?string { $source = $other ?: $name; $parts = preg_split('/\s+/', trim($source)); return $parts[0] ?: null; } private function mapGradeToRoleAndWhois(int $grade): array { return [3 => ['probationer', 'probationer']][$grade] ?? ['member', 'member']; } } EOF #1775198760 php artisan make:command ImportProMembers #1775198827 cat << 'EOF' > app/Console/Commands/ImportProbMembers.php <?php namespace App\Console\Commands; use App\Models\User; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; class ImportProbMembers extends Command { protected $signature = 'import:probationers {--chunk=100}'; protected $description = 'Import Grade 3 Probationers only'; public function handle() { DB::disableQueryLog(); $chunk = (int) $this->option('chunk'); $query = DB::table('members_old')->where('memberGrade', 3); $total = $query->count(); $this->info("Found {$total} Probationers. Starting import..."); $bar = $this->output->createProgressBar($total); $query->orderBy('memberID')->chunkById($chunk, function ($rows) use ($bar) { foreach ($rows as $r) { $email = strtolower(trim($r->memberEmail ?? "")); if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) { $email = "probationer{$r->memberID}@niqs.org.ng"; } $user = User::updateOrCreate( ['email' => $email], [ 'name' => trim(($r->memberSurname ?? '').' '.($r->memberOthernames ?? '')), 'password' => bcrypt('password123'), 'whois' => 'probationer', 'must_change_password' => true, 'email_verified_at' => now(), ] ); $user->syncRoles(['probationer']); DB::table('members')->updateOrInsert( ['old_member_id' => $r->memberID], [ 'id' => (string) Str::uuid(), 'user_id' => $user->id, 'surname' => $r->memberSurname ?? null, 'firstname' => explode(' ', trim($r->memberOthernames ?? ''))[0] ?? 'Member', 'email' => $email, 'grade' => '3', 'created_at' => now(), 'updated_at' => now(), ] ); $bar->advance(); } }, 'memberID', 'memberID'); $bar->finish(); $this->newLine(); $this->info('Import complete!'); return self::SUCCESS; } } EOF #1775199134 php artisan optimize:clear #1775199349 ls -R app/Console/Commands #1776192513 cd ggh_api #1776192597 php artisan config:clear #1776192598 php artisan cache:clear #1776192615 storage/logs/ #1776192704 chmod -R 775 storage #1776192704 chmod -R 775 bootstrap/cache #1776193141 composer install --no-dev --optimize-autoloader #1776194066 php artisan config:clear #1776194066 php artisan cache:clear #1776194230 php artisan optimize:clear #1776194268 rm -f bootstrap/cache/*.php #1776194291 php artisan config:clea #1776194310 php artisan optimize:clear #1776237127 cd ggh_api #1776237129 php artisan optimize:clear #1776237129 php artisan config:clear #1776237129 php artisan cache:clear #1776237130 composer dump-autoload