149 Commits

Author SHA1 Message Date
c2b7c43bf0 Merge pull request 'changed logic in edit transporter bid' (#150) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #150
2026-01-27 08:40:34 +00:00
d993b64906 Merge pull request 'removed dd in edit transporter page' (#149) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #149
2026-01-27 07:11:19 +00:00
0c9d5a7964 Merge pull request 'Added dd in edit transporter page' (#148) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #148
2026-01-27 07:02:57 +00:00
aa0b94a975 Merge pull request 'changed logic in edit transporter bid' (#147) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #147
2026-01-27 06:42:20 +00:00
ae0bc9dcd6 Merge pull request 'removed dd in edit transporter bid' (#146) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #146
2026-01-27 06:34:13 +00:00
5d8e5d13f5 Merge pull request 'removed _id in model file' (#145) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #145
2026-01-27 06:33:01 +00:00
6747abb2db Merge pull request 'changed logic in edit transporter bid' (#144) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #144
2026-01-27 06:29:53 +00:00
d27ab1d98e Merge pull request 'changed logic in user model' (#143) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #143
2026-01-27 06:24:31 +00:00
0f38a9ff1b Merge pull request 'added dd in edit transporter page' (#142) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #142
2026-01-27 06:22:02 +00:00
667682201a Merge pull request 'changed logic in edit transporter bid page' (#141) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #141
2026-01-27 06:14:17 +00:00
e20caa54c7 Merge pull request 'Added PushSubscription method in the user model' (#140) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #140
2026-01-27 06:12:51 +00:00
efa6410cd9 Merge pull request 'chnaged logic in edit transporter bid page' (#139) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #139
2026-01-27 06:11:56 +00:00
eae7e76ea4 Merge pull request 'changed registerPush method logic in push.js' (#138) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #138
2026-01-27 06:00:10 +00:00
30e4415af9 Merge pull request 'change dlogin in web.php and added web push subscription model file' (#137) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #137
2026-01-27 05:31:41 +00:00
40014570c9 Merge pull request 'changed logic in edit transporter bid' (#136) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 2m22s
Reviewed-on: #136
2026-01-27 05:01:14 +00:00
c5e45cd6dd Merge pull request 'changed design for notification settings' (#135) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #135
2026-01-24 11:10:03 +00:00
2d40e51e78 Merge pull request 'changed logic in rfq transporter' (#134) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #134
2026-01-24 10:55:25 +00:00
98a3c5bc8e Merge pull request 'Added after create logic inside the rfq transporter bid' (#133) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #133
2026-01-24 10:07:07 +00:00
e969e54f59 Merge pull request 'Added after craete method in transporter bid' (#132) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #132
2026-01-24 09:37:08 +00:00
6bad120e70 Merge pull request 'changed logic in transporter bid' (#131) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #131
2026-01-24 09:30:53 +00:00
02dea13222 Merge pull request 'removed dd in push notification' (#130) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #130
2026-01-24 09:25:29 +00:00
07c642e3bd Merge pull request 'changed logic in bid transporter page' (#129) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #129
2026-01-24 09:24:07 +00:00
33e3b247b3 Merge pull request 'Addded dd fior checking web push' (#128) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #128
2026-01-24 09:00:56 +00:00
0bcc8d2113 Merge pull request 'changed logic in transporter bid' (#127) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #127
2026-01-24 07:37:14 +00:00
ff607695bc Merge pull request 'changed logic in push alert notification page' (#126) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #126
2026-01-24 07:29:31 +00:00
006857ec89 Merge pull request 'chanaged logic for rfq transporter bid' (#125) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #125
2026-01-24 07:11:20 +00:00
107e8cf505 Merge pull request 'changed logic in manifest.json' (#124) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #124
2026-01-24 06:46:50 +00:00
49d5dfb664 Merge pull request 'Added gcm sender id in manifest.json' (#123) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #123
2026-01-24 06:42:31 +00:00
cf097255a0 Merge pull request 'Added service worker js' (#122) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #122
2026-01-24 06:05:03 +00:00
27223612d3 Merge pull request 'changed logic in service worker.js' (#121) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #121
2026-01-24 05:58:44 +00:00
22de1ba081 Merge pull request 'Added has push subscriptions in user model file' (#120) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #120
2026-01-24 04:47:44 +00:00
d7c2fc3ff9 Merge pull request 'changed logic in invoice validation' (#119) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #119
2026-01-24 04:43:38 +00:00
29a7a66ff4 Merge pull request 'Added web push route in web.php' (#118) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #118
2026-01-24 04:40:45 +00:00
5f87467dbf Merge pull request 'Added push aert notification page' (#117) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #117
2026-01-24 04:35:34 +00:00
c01df679a0 Merge pull request 'Added push alert notification sample' (#116) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #116
2026-01-24 04:34:14 +00:00
4b653f6bb0 Merge pull request 'added web push notification in pwa' (#115) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #115
2026-01-24 04:25:38 +00:00
a877623567 Merge pull request 'added package for web push notification' (#114) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #114
2026-01-24 04:23:12 +00:00
e8a6e88eac Merge pull request 'changed logic in push.js' (#113) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #113
2026-01-24 04:17:44 +00:00
ab49a0fc7c Merge pull request 'Added service worker js and push.js' (#112) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #112
2026-01-23 12:46:22 +00:00
e320e4486f Merge pull request 'registered push.js in admin panel provider' (#111) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #111
2026-01-23 12:43:05 +00:00
4b5cdef55a Merge pull request 'Added notification settings page' (#110) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #110
2026-01-23 12:41:20 +00:00
82a022d3b4 Merge pull request 'removed route logic' (#109) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #109
2026-01-23 11:31:20 +00:00
7ec116ca0b Merge pull request 'Added admin welcome page' (#108) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #108
2026-01-23 11:20:21 +00:00
048f069dd7 Merge pull request 'Added welcome page in cri' (#107) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #107
2026-01-23 11:02:24 +00:00
b83e26c9d6 Merge pull request 'changed logic in pwa install' (#106) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #106
2026-01-23 10:10:01 +00:00
945d50c504 Merge pull request 'ranjith-dev' (#105) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #105
2026-01-23 10:00:31 +00:00
ae0758a9c0 Merge pull request 'changed logic in rfq transporter bid resource page' (#104) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #104
2026-01-23 09:40:28 +00:00
238d7bdfa7 Merge pull request 'Added spot rate transport master policy file' (#103) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #103
2026-01-23 09:39:14 +00:00
be1e7f36b2 Merge pull request 'Added request quotation policy file' (#102) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #102
2026-01-23 09:38:06 +00:00
165b7e6a77 Merge pull request 'Added rfq transporter bid policy file' (#101) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #101
2026-01-23 09:37:20 +00:00
d0269a646c Merge pull request 'Added rfq chart and rfq rank chart widgets page' (#100) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #100
2026-01-23 07:27:29 +00:00
3eccb1c7d5 Merge pull request 'Added rfq dashboard and rfq overview pages' (#99) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #99
2026-01-23 07:26:21 +00:00
83888054e9 Merge pull request 'Added rfq transporter bid resource pages' (#98) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #98
2026-01-23 07:23:30 +00:00
22e2fbd25d Merge pull request 'Added rfq transporter bid model file' (#97) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #97
2026-01-23 07:22:02 +00:00
d5d1243d5c Merge pull request 'Added rfq transporter bid migration file' (#96) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #96
2026-01-23 07:20:47 +00:00
2d2d3ac8c5 Merge pull request 'Added request quotation resource pages' (#95) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #95
2026-01-23 07:18:05 +00:00
6e9e57682c Merge pull request 'Added request quotation model file' (#94) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #94
2026-01-23 07:16:21 +00:00
3fa6ca578b Merge pull request 'added request quotation migartion file' (#93) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #93
2026-01-23 07:15:06 +00:00
bc43d5ddf1 Merge pull request 'Added spot rate transport master resource pages' (#92) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #92
2026-01-23 07:11:06 +00:00
201c55121e Merge pull request 'Added spot rate master model file' (#91) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #91
2026-01-23 07:08:24 +00:00
aa91bd80de Merge pull request 'Added spot rate transport master migration file' (#90) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #90
2026-01-23 06:09:48 +00:00
d4fc6f6f33 Merge pull request 'changed logic for safari browser pwa' (#89) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #89
2026-01-01 08:35:02 +00:00
dade6a3c0c Merge pull request 'Added logo for the application of pwa' (#88) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #88
2026-01-01 05:49:55 +00:00
d8aea01b26 Merge pull request 'Added manifest.json and changed name of teh application' (#87) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #87
2026-01-01 05:14:18 +00:00
a690faf6d7 Merge pull request 'changed logic for kiosk mode to take print out in sticker validation' (#86) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #86
2025-12-30 11:06:58 +00:00
dd6cbd92a2 Merge pull request 'Added pdf generate method for sticker validation' (#85) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #85
2025-12-30 09:19:24 +00:00
b54a9af78b Merge pull request 'Added sticker validation livewire pages' (#84) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #84
2025-12-30 08:59:00 +00:00
57f059aca8 Merge pull request 'Added sticker validation blade file' (#83) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #83
2025-12-30 08:57:51 +00:00
5688e93862 Merge pull request 'Added Sticker Validation resource pages' (#82) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #82
2025-12-30 08:56:26 +00:00
8b556d3c9c Merge pull request 'Added Sticker Validation model file' (#81) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #81
2025-12-30 08:55:06 +00:00
091aaaa0d7 Merge pull request 'Added sticker validation migration file' (#80) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #80
2025-12-30 08:53:55 +00:00
9dd5d04b3c Merge pull request 'Added sticker mapping master importer and exporter' (#79) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #79
2025-12-30 08:46:59 +00:00
4ac3eb4f2f Merge pull request 'Added sticker mapping master resource pages' (#78) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #78
2025-12-30 08:40:35 +00:00
bcd493901c Merge pull request 'Added sticker mapping master model file' (#77) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #77
2025-12-30 08:39:11 +00:00
af3259a842 Merge pull request 'Added sticker mapping master migration file' (#76) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #76
2025-12-30 08:38:43 +00:00
6f41238b1e Merge pull request 'Added validation in importer and exporter of sticker structure details' (#75) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #75
2025-12-25 12:03:45 +00:00
8779e66a18 Merge pull request 'Added validation logic in sticker detail for importer and exporter' (#74) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #74
2025-12-25 12:01:11 +00:00
e0384780dc Merge pull request 'Remove dimage path and image type in sticker detail model file' (#73) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #73
2025-12-25 07:43:39 +00:00
afbbfe2aca Merge pull request 'Removed image path and image type in sticker detail resource' (#72) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #72
2025-12-25 07:42:34 +00:00
4fb04c9fa8 Merge pull request 'removed image type column from sticker details migration' (#71) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #71
2025-12-25 07:40:24 +00:00
656c58999c Merge pull request 'removed image path column in sticker details' (#70) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #70
2025-12-25 07:36:56 +00:00
102bc62805 Merge pull request 'Commented heading tag on preview' (#69) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #69
2025-12-23 12:23:14 +00:00
ef1ad62749 Merge pull request 'removed unwanted file in fields' (#68) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #68
2025-12-23 12:22:21 +00:00
1e0193e6c9 Merge pull request 'Added item and plant models' (#67) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #67
2025-12-23 12:19:20 +00:00
18c203552c Merge pull request 'Commented Blade File' (#66) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #66
2025-12-23 12:18:05 +00:00
61190edcce Merge pull request 'changed logic in sticker preview' (#65) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #65
2025-12-23 12:17:23 +00:00
62774aec0f Merge pull request 'changed logic in sticker pdf service' (#64) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #64
2025-12-23 12:16:15 +00:00
44e58d2d78 Merge pull request 'Added show preview method in sticker pdf service' (#63) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Reviewed-on: #63
2025-12-23 12:04:02 +00:00
3ac4f88155 Merge pull request 'Added sticker structure preview page blade file' (#62) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #62
2025-12-23 12:00:01 +00:00
818f8a3e08 Merge pull request 'Added Sticker Preview page custom filament page' (#61) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #61
2025-12-23 11:58:45 +00:00
86798212d0 Merge pull request 'Removed sticker mapping master resource files' (#60) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #60
2025-12-23 11:25:53 +00:00
837bd58177 Merge pull request 'Removed model file of sticker mapping master' (#59) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #59
2025-12-23 11:23:13 +00:00
d8b29ba000 Merge pull request 'removed sticker mapping migration file' (#58) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #58
2025-12-23 11:21:54 +00:00
d1db3e0dad Merge pull request 'added null for design element type in resource page' (#57) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #57
2025-12-23 10:57:01 +00:00
f274de00e1 Merge pull request 'added visible to all text boxes based on design element type' (#56) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #56
2025-12-23 10:51:15 +00:00
f9c6405b61 Merge pull request 'Added curved rectangle in sticker pdf service' (#55) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #55
2025-12-23 09:54:48 +00:00
7ec34a04fc Merge pull request 'Added curve radius in sticker details resource pages' (#54) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #54
2025-12-23 09:53:19 +00:00
9256e1ed12 Merge pull request 'added curve radius in model file of sticker details' (#53) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #53
2025-12-23 09:52:27 +00:00
b334ba60fa Merge pull request 'Added curve radius column in sticker details' (#52) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #52
2025-12-23 09:48:11 +00:00
8c81c140d1 Merge pull request 'Added logic in pdf controller' (#51) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #51
2025-12-23 06:19:16 +00:00
5ff8acac74 Merge pull request 'Modified logic in generate template' (#50) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #50
2025-12-23 05:56:29 +00:00
2f2bab37d4 Merge pull request 'Added plant and item characteritivcs id in resource page' (#49) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #49
2025-12-23 05:51:19 +00:00
a8d72923ae Merge pull request 'ranjith-dev' (#48) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #48
2025-12-23 05:50:34 +00:00
e39ab23142 Merge pull request 'Added dynamic logic in pdf controller' (#47) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #47
2025-12-23 05:44:55 +00:00
2373e1d427 Merge pull request 'Added Sticker pdf service logic for dynamic values' (#46) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #46
2025-12-23 05:44:01 +00:00
baa165e285 Merge pull request 'Added route file in web.php' (#45) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #45
2025-12-23 05:42:43 +00:00
53e671d612 Merge pull request 'Added characteritics type in resource page' (#44) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #44
2025-12-23 05:41:34 +00:00
58be303cfe Merge pull request 'Added characteristics type in model file' (#43) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #43
2025-12-23 05:40:18 +00:00
a1c39c5f0e Merge pull request 'Added characteritics type column in sticker detail' (#42) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #42
2025-12-23 05:39:12 +00:00
41e8c04b9d Merge pull request 'hidden the sticker_id_live form in resource' (#41) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Reviewed-on: #41
2025-12-22 12:28:02 +00:00
6a30fbc8f2 Merge pull request 'Added logic for validation in generate temp' (#40) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #40
2025-12-22 12:26:51 +00:00
9e57461d3a Merge pull request 'Added validation part for generate pdf' (#39) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #39
2025-12-22 12:19:39 +00:00
ab5a6b94c9 Merge pull request 'Added string value in forms and tables' (#38) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #38
2025-12-22 12:09:51 +00:00
84b78ea0c1 Merge pull request 'changed logic in sticker pdf service' (#37) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #37
2025-12-22 12:08:43 +00:00
5e46b080c5 Merge pull request 'Added sticker pdf service file' (#36) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #36
2025-12-22 11:57:49 +00:00
17f337e8db Merge pull request 'Added sticker generate route in web file' (#35) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #35
2025-12-22 11:53:40 +00:00
2781d57e3f Merge pull request 'Added generate method in pdf controller' (#34) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #34
2025-12-22 11:52:32 +00:00
5628e8abd4 Merge pull request 'Added generate pdf blade file' (#33) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #33
2025-12-22 11:51:41 +00:00
e56733ce44 Merge pull request 'Added item characteristics policy file' (#32) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #32
2025-12-22 11:49:18 +00:00
b3f32f6813 Merge pull request 'Added item characteristics resource files' (#31) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #31
2025-12-22 11:47:17 +00:00
b2937ccfa8 Merge pull request 'Added item characteristics model file' (#30) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #30
2025-12-22 11:46:06 +00:00
026e4982b8 Merge pull request 'Added item characteristics migration file' (#29) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #29
2025-12-22 11:45:27 +00:00
6478bc3722 Merge pull request 'Added sticker detail policy file' (#28) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #28
2025-12-22 11:43:41 +00:00
1ab7ed2da9 Merge pull request 'Added sticker deatil importer and exporter' (#27) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #27
2025-12-22 11:41:57 +00:00
9ecd04f0e3 Merge pull request 'Added sticker detail resource page' (#26) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #26
2025-12-22 11:41:04 +00:00
53179ea538 Merge pull request 'Added sticker detail model file' (#25) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #25
2025-12-22 11:39:46 +00:00
b4e24c581e Merge pull request 'Added sticker details migration file' (#24) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #24
2025-12-22 11:38:28 +00:00
4938fa62a7 Merge pull request 'Added sticker structure policy file' (#23) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #23
2025-12-22 11:34:44 +00:00
01f6288c63 Merge pull request 'Added importer and exporter of sticker structure detail' (#22) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #22
2025-12-22 11:33:09 +00:00
c9c7c38088 Merge pull request 'Added sticker structure detail resource pages' (#21) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #21
2025-12-22 11:32:08 +00:00
90cfe9ef0d Merge pull request 'Added sticker structure detail model file' (#20) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #20
2025-12-22 11:30:56 +00:00
aa806f2fe3 Merge pull request 'Added sticker structure detail migration file' (#19) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #19
2025-12-22 11:30:11 +00:00
0eb6f76ca6 Merge pull request 'Enhance Gemini review step to handle errors and provide feedback on review status' (#18) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #18
2025-12-18 06:34:16 +00:00
73366ccd70 Merge pull request 'Update Gemini review step to use gemini-pro model for code analysis' (#17) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #17
2025-12-18 06:31:07 +00:00
acbecedce9 Merge pull request 'Update Gemini review step to use gemini-1.5-flash model for code analysis' (#16) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #16
2025-12-18 06:28:15 +00:00
614d89932b Merge pull request 'Update Gemini review step to use GPT-5-mini model for code analysis' (#15) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #15
2025-12-18 06:26:56 +00:00
c839c6fdbc Merge pull request 'Remove unnecessary blank line in Gemini PR Review workflow' (#14) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Reviewed-on: #14
2025-12-18 05:16:54 +00:00
d9445a9d4b Merge pull request 'Refactor Gemini PR Review workflow' (#13) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #13
2025-12-18 04:48:44 +00:00
50476c8a2c Merge pull request 'Added nav group name in ocr validation resource page' (#12) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #12
2025-12-17 06:22:14 +00:00
c57cfe71ca Merge pull request 'Added nav group for web capture page' (#11) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #11
2025-12-17 06:21:40 +00:00
96c08c34c1 Merge pull request 'Added nav group in reject reason resource page' (#10) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #10
2025-12-17 06:20:01 +00:00
19cf7c8edd Merge pull request 'Added nav group for production reject reason resource page' (#9) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #9
2025-12-17 06:19:03 +00:00
66086dd2d7 Merge pull request 'Added nav group in product characteristics resource page' (#8) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #8
2025-12-17 06:16:38 +00:00
5da724c9a4 Merge pull request 'Added nav group in gr master resource page' (#7) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #7
2025-12-17 06:15:52 +00:00
6b723c0929 Merge pull request 'Added navigation sort for sticker mapping resource page' (#6) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #6
2025-12-17 06:13:44 +00:00
8e20d0732d Merge pull request 'Added nav group for sticker printing resource page' (#5) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #5
2025-12-17 06:11:56 +00:00
1d8fb1c9aa Merge pull request 'Added nav group for sticker master mapping resource' (#4) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #4
2025-12-17 06:11:07 +00:00
33bbce47ba Merge pull request 'Added navigation group for class characteristics' (#3) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #3
2025-12-17 06:08:01 +00:00
860ff96134 Merge pull request 'Added driver master migration file' (#2) from fix-migration into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Reviewed-on: #2
2025-12-17 03:52:20 +00:00
29 changed files with 2040 additions and 3337 deletions

View File

@@ -1,62 +0,0 @@
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
class ProductionPlanExport implements FromArray, WithHeadings, WithMapping
{
protected array $data;
protected array $dates;
public function __construct(array $data, array $dates)
{
$this->data = $data;
$this->dates = $dates;
}
public function array(): array
{
return $this->data;
}
public function headings(): array
{
$headings = [
'Plant Name',
'Line Name',
'Item Code',
];
// Add dynamic headings for each date: Target / Produced
foreach ($this->dates as $date) {
$headings[] = $date . ' - Target Plan';
$headings[] = $date . ' - Produced Quantity';
}
return $headings;
}
public function map($row): array
{
$mapped = [
$row['plant_name'] ?? '',
$row['line_name'] ?? '',
$row['item_code'] ?? '',
];
// Add daily target and produced quantity for each date
foreach ($this->dates as $date) {
// $mapped[] = $row['daily_target_dynamic'] ?? 0;
$mapped[] = $row['daily_target_dynamic'][$date] ?? '-';
$mapped[] = $row['produced_quantity'][$date] ?? 0;
}
return $mapped;
}
}

View File

@@ -3,7 +3,6 @@
namespace App\Filament\Imports; namespace App\Filament\Imports;
use App\Models\Block; use App\Models\Block;
use App\Models\Item;
use App\Models\Line; use App\Models\Line;
use App\Models\Plant; use App\Models\Plant;
use App\Models\ProductionPlan; use App\Models\ProductionPlan;
@@ -24,33 +23,11 @@ class ProductionPlanImporter extends Importer
public static function getColumns(): array public static function getColumns(): array
{ {
return [ return [
// ImportColumn::make('created_at') ImportColumn::make('created_at')
// ->requiredMapping()
// ->exampleHeader('Created DateTime')
// ->example(['01-01-2025 08:00:00', '01-01-2025 19:30:00'])
// ->label('Created DateTime')
// ->rules(['required']),
ImportColumn::make('plant')
->requiredMapping() ->requiredMapping()
->exampleHeader('Plant Code') ->exampleHeader('Created DateTime')
->example(['1000', '1000']) ->example(['01-01-2025 08:00:00', '01-01-2025 19:30:00'])
->label('Plant Code') ->label('Created DateTime')
->relationship(resolveUsing: 'code')
->rules(['required']),
ImportColumn::make('line')
->requiredMapping()
->exampleHeader('Line Name')
->example(['4 inch pump line', '4 inch pump line'])
->label('Line Name')
->relationship(resolveUsing: 'name')
->rules(['required']),
ImportColumn::make('item')
->requiredMapping()
->exampleHeader('Item Code')
->example(['123456', '210987'])
->label('Item Code')
->relationship(resolveUsing: 'code')
->rules(['required']), ->rules(['required']),
ImportColumn::make('plan_quantity') ImportColumn::make('plan_quantity')
->requiredMapping() ->requiredMapping()
@@ -59,111 +36,175 @@ class ProductionPlanImporter extends Importer
->label('Plan Quantity') ->label('Plan Quantity')
->numeric() ->numeric()
->rules(['required', 'integer']), ->rules(['required', 'integer']),
// ImportColumn::make('production_quantity') ImportColumn::make('production_quantity')
// ->requiredMapping() ->requiredMapping()
// ->exampleHeader('Production Quantity') ->exampleHeader('Production Quantity')
// ->example(['0', '0']) ->example(['0', '0'])
// ->label('Production Quantity') ->label('Production Quantity')
// ->numeric() ->numeric()
// ->rules(['required', 'integer']), ->rules(['required', 'integer']),
ImportColumn::make('line')
// ImportColumn::make('block_reference') ->requiredMapping()
// ->requiredMapping() // Or optionalMapping() if not always present ->exampleHeader('Line Name')
// ->exampleHeader('Block Name') ->example(['4 inch pump line', '4 inch pump line'])
// ->example(['Block A', 'Block A']) ->label('Line Name')
// ->label('Block Name') ->relationship(resolveUsing:'name')
// ->rules(['required']), // Or remove if not required ->rules(['required']),
// ImportColumn::make('shift') ImportColumn::make('block_reference')
// ->requiredMapping() ->requiredMapping() // Or optionalMapping() if not always present
// ->exampleHeader('Shift Name') // ID ->exampleHeader('Block Name')
// ->example(['Day', 'Night']) // '2', '7' ->example(['Block A', 'Block A'])
// ->label('Shift Name') // ID ->label('Block Name')
// ->relationship(resolveUsing: 'name') ->rules(['required']), // Or remove if not required
// ->rules(['required']), ImportColumn::make('shift')
->requiredMapping()
// ImportColumn::make('updated_at') ->exampleHeader('Shift Name') //ID
// ->requiredMapping() ->example(['Day', 'Night']) //'2', '7'
// ->exampleHeader('Updated DateTime') ->label('Shift Name') // ID
// ->example(['01-01-2025 08:00:00', '01-01-2025 19:30:00']) ->relationship(resolveUsing: 'name')
// ->label('Updated DateTime') ->rules(['required']),
// ->rules(['required']), ImportColumn::make('plant')
// ImportColumn::make('operator_id') ->requiredMapping()
// ->requiredMapping() ->exampleHeader('Plant Name')
// ->exampleHeader('Operator ID') ->example(['Ransar Industries-I', 'Ransar Industries-I'])
// ->example([Filament::auth()->user()->name, Filament::auth()->user()->name]) ->label('Plant Name')
// ->label('Operator ID') ->relationship(resolveUsing:'name')
// ->rules(['required']), ->rules(['required']),
ImportColumn::make('updated_at')
->requiredMapping()
->exampleHeader('Updated DateTime')
->example(['01-01-2025 08:00:00', '01-01-2025 19:30:00'])
->label('Updated DateTime')
->rules(['required']),
ImportColumn::make('operator_id')
->requiredMapping()
->exampleHeader('Operator ID')
->example([Filament::auth()->user()->name, Filament::auth()->user()->name])
->label('Operator ID')
->rules(['required']),
]; ];
} }
public function resolveRecord(): ?ProductionPlan public function resolveRecord(): ?ProductionPlan
{ {
$warnMsg = []; $warnMsg = [];
$plantCod = $this->data['plant']; $plant = Plant::where('name', $this->data['plant'])->first();
$itemCod = $this->data['item'];
$plant = null;
$line = null; $line = null;
$block = null; $block = null;
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
$warnMsg[] = 'Invalid plant code found';
} else {
$plant = Plant::where('code', $plantCod)->first();
}
if (!$plant) { if (!$plant) {
$warnMsg[] = 'Plant not found'; $warnMsg[] = "Plant not found";
} else { }
else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first(); $line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
//block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
} }
if (!$line) { if (!$line) {
$warnMsg[] = 'Line not found'; $warnMsg[] = "Line not found";
} }
$shift = null;
if (Str::length($itemCod) < 6 || ! is_numeric($itemCod)) { if (!$block) {
$warnMsg[] = 'Invalid item code found'; $warnMsg[] = "Block not found";
} else {
$item = Item::where('code', $itemCod)->first();
} }
else {
if (! $item) { $shift = Shift::where('name', $this->data['shift'])->where('plant_id', $plant->id)->where('block_id', $block->id)->first();
$warnMsg[] = 'Item not found';
} }
//$shift = Shift::where('id', $this->data['shift'])->where('plant_id', $plant->id)->first();
$plantId = $plant->id; if (!$shift) {
$warnMsg[] = "Shift not found";
$itemAgaPlant = Item::where('plant_id', $plantId)->where('code', $itemCod)->first();
if(!$itemAgaPlant){
$warnMsg[] = 'Item not found against plant code';
} }
$user = Filament::auth()->user();
$operatorName = $user->name;
if (Str::length($this->data['plan_quantity']) < 0 || !is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) { if (Str::length($this->data['plan_quantity']) < 0 || !is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
$warnMsg[] = 'Invalid plan quantity found'; $warnMsg[] = "Invalid plan quantity found";
}
if (Str::length($this->data['production_quantity']) < 0 || !is_numeric($this->data['production_quantity']) || $this->data['production_quantity'] < 0) {
$warnMsg[] = "Invalid production quantity found";
}
$fromDate = $this->data['created_at'];
$toDate = $this->data['updated_at'];
$formats = ['d-m-Y H:i', 'd-m-Y H:i:s']; //'07-05-2025 08:00' or '07-05-2025 08:00:00'
$fdateTime = null;
$tdateTime = null;
// Try parsing with multiple formats
foreach ($formats as $format) {
try {
$fdateTime = Carbon::createFromFormat($format, $fromDate);
break;
} catch (\Exception $e) {
// Optionally collect warning messages
// $warnMsg[] = "Date format mismatch with format: $format";
}
}
foreach ($formats as $format) {
try {
$tdateTime = Carbon::createFromFormat($format, $toDate);
break;
} catch (\Exception $e) {
// Optionally collect warning messages
// $warnMsg[] = "Date format mismatch with format: $format";
}
}
$fDateOnly = '';
if (!isset($fdateTime)) {
// throw new \Exception('Invalid date time format');
$warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
else {
$fDateOnly = $fdateTime->toDateString();
}
if (!isset($tdateTime)) {
$warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
}
if (isset($fdateTime) && isset($tdateTime)) {
if ($fdateTime->greaterThan($tdateTime)) {
$warnMsg[] = "'Created DataTime' is greater than 'Updated DateTime'.";
}
}
// if (!$fromDate) {
// $warnMsg[] = "Invalid 'Created DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
// }
// else if (!$toDate) {
// $warnMsg[] = "Invalid 'Updated DateTime' format. Expected DD-MM-YYYY HH:MM:SS";
// }
$user = User::where('name', $this->data['operator_id'])->first();
if (!$user) {
$warnMsg[] = "Operator ID not found";
} }
if (!empty($warnMsg)) { if (!empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg)); throw new RowImportFailedException(implode(', ', $warnMsg));
} else { }
else { //if (empty($warnMsg))
$productionPlan = ProductionPlan::where('plant_id', $plant->id) $productionPlan = ProductionPlan::where('plant_id', $plant->id)
->where('shift_id', $shift->id)
->where('line_id', $line->id) ->where('line_id', $line->id)
->where('item_id', $itemAgaPlant->id) ->whereDate('created_at', $fDateOnly)
// ->where('plan_quantity', $productionQuantity->plan_quantity)
->latest() ->latest()
->first(); ->first();
if ($productionPlan) { if ($productionPlan) {
// if($productionPlan->production_quantity)
// {
// throw new RowImportFailedException("{$productionPlan->created_at}, {$productionPlan->production_quantity}");
// }
// $warnMsg[] = "Production plan already exist on '{$fDateOnly}'!";
$productionPlan->update([ $productionPlan->update([
'plan_quantity' => $this->data['plan_quantity'], 'plan_quantity' => $this->data['plan_quantity'],
'operator_id' => $operatorName, // 'production_quantity' => $productionPlan->production_quantity,
// 'created_at' => $productionPlan->created_at,//$fdateTime->format('Y-m-d H:i:s'),
// 'updated_at' => $tdateTime->format('Y-m-d H:i:s'),
'operator_id' => $this->data['operator_id'],
]); ]);
$productionPlan->save(); $productionPlan->save();
return null; return null;
} }
} }
@@ -171,15 +212,20 @@ class ProductionPlanImporter extends Importer
ProductionPlan::updateOrCreate([ ProductionPlan::updateOrCreate([
'plant_id' => $plant->id, 'plant_id' => $plant->id,
'line_id' => $line->id, 'line_id' => $line->id,
'item_id' => $itemAgaPlant->id, 'shift_id' => $shift->id,
// 'shift_id' => $shift->id,
'plan_quantity' => $this->data['plan_quantity'], 'plan_quantity' => $this->data['plan_quantity'],
'created_at' =>now(), 'production_quantity' => $this->data['production_quantity'],
'updated_at' => now(), 'created_at' => $fdateTime->format('Y-m-d H:i:s'),//$this->data['created_at'],
'operator_id' => $operatorName, 'updated_at' => $tdateTime->format('Y-m-d H:i:s'),//$this->data['updated_at'],
'operator_id' => $this->data['operator_id'],
]); ]);
return null; return null;
// return ProductionPlan::firstOrNew([
// // Update existing records, matching them by `$this->data['column_name']`
// 'email' => $this->data['email'],
// ]);
// return new ProductionPlan();
} }
public static function getCompletedNotificationBody(Import $import): string public static function getCompletedNotificationBody(Import $import): string

View File

@@ -1,163 +0,0 @@
<?php
namespace App\Filament\Pages;
use App\Models\CustomerPoMaster;
use App\Models\Plant;
use App\Models\ProductionPlan;
use App\Models\WireMasterPacking;
use Filament\Facades\Filament;
use Filament\Pages\Page;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Form;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\ViewField;
use Filament\Notifications\Notification;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Hidden;
class ProductionCalender extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.production-calender';
use InteractsWithForms;
protected $listeners = ['setWorkingDays'];
public $pId;
public array $filters = [];
public function setWorkingDays($days = null)
{
$this->form->fill([
'working_days' => $days ?? 0,
]);
}
public function form(Form $form): Form
{
return $form
->statePath('filters')
->schema([
Section::make('')
->schema([
Select::make('plant_id')
->label('Plant')
->reactive()
//->options(Plant::pluck('name', 'id'))
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->columnSpan(['default' => 10, 'sm' => 7])
->required()
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('working_days', null);
}),
TextInput::make('working_days')
->label('No. of Working Days')
->numeric()
->readOnly()
->columnSpan(['default' => 10, 'sm' => 2])
->required()
->minValue(0)
->maxValue(31)
->placeholder('Enter working days')
->id('working_days'),
Hidden::make('month')
->label('Month')
->id('month'),
Hidden::make('year')
->label('Year')
->id('year'),
Hidden::make('selected_dates')
->label('Selected Dates')
->id('selected_dates'),
ViewField::make('save')
->view('forms.save')
->columnSpan(['default' => 10, 'sm' => 1]),
ViewField::make('calendar')
->view('forms.calendar')
->columnspan(10),
])
->columns(10)
]);
}
public function saveWorkingDays(){
$plantId = $this->filters['plant_id'] ?? null;
$workingDays = $this->filters['working_days'] ?? null;
$month = $this->filters['month'] ?? null;
$year = $this->filters['year'] ?? null;
$dates = $this->filters['selected_dates'] ?? null;
if (!$plantId) {
Notification::make()
->title('Unknown Plant')
->body("Please select a plant first!")
->danger()
->send();
return;
}
else if (!$workingDays) {
Notification::make()
->title('Unknown Working Days')
->body("Working days can't be empty!")
->danger()
->send();
return;
}
else if (!$month) {
Notification::make()
->title('Unknown Month')
->body("month can't be empty!")
->danger()
->send();
return;
}
else if (!$year) {
Notification::make()
->title('Unknown Year')
->body("Year can't be empty!")
->danger()
->send();
return;
}
$updated = ProductionPlan::where('plant_id', $plantId)
->whereMonth('created_at', $month)
->whereYear('created_at', $year)
->update([
'working_days' => $workingDays,
'leave_dates' => $dates,
'updated_at' => now(),
]);
if ($updated) {
Notification::make()
->title('Success')
->body("Working days updated successfully!")
->success()
->send();
} else {
Notification::make()
->title('No Records Updated')
->body("No production plans found for this plant and month.")
->warning()
->send();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,173 +0,0 @@
<?php
namespace App\Filament\Pages;
use App\Models\Plant;
use Filament\Facades\Filament;
use Filament\Forms\Components\DatePicker;
use Filament\Pages\Page;
use Filament\Forms\Form;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
class ProductionTarget extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';
protected static string $view = 'filament.pages.production-target';
public array $filters = [];
public function form(Form $form): Form
{
return $form
->statePath('filters')
->schema([
Section::make('')
->schema([
Select::make('plant_id')
->label('Plant')
->reactive()
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->required()
->afterStateUpdated(function ($state, callable $get, $set) {
$set('line_id', null);
$set('year', null);
$set('month', null);
$this->dispatch('loadData',$state, '', '', '');
}),
Select::make('line_id')
->label('Line')
->required()
->columnSpan(1)
->options(function (callable $get) {
if (!$get('plant_id')) {
return [];
}
return \App\Models\Line::where('plant_id', $get('plant_id'))
->pluck('name', 'id')
->toArray();
})
->reactive()
->afterStateUpdated(function ($state, callable $get, $set) {
$plantId = $get('plant_id');
$set('year', null);
$set('month', null);
$this->dispatch('loadData',$plantId, $state, '', '');
}),
Select::make('year')
->label('Year')
->reactive()
->options([
'2026' => '2026',
'2027' => '2027',
'2028' => '2028',
'2029' => '2029',
'2030' => '2030',
'2031' => '2031',
'2032' => '2032',
'2033' => '2033',
'2034' => '2034',
'2035' => '2035',
'2036' => '2036',
'2037' => '2037',
'2038' => '2038',
'2039' => '2039',
'2040' => '2040',
])
->required()
->afterStateUpdated(function ($state, callable $get, $set) {
$set('month', null);
$plantId = $get('plant_id');
$lineId = $get('line_id');
$this->dispatch('loadData',$plantId, $lineId, $state, '');
}),
Select::make('month')
->label('Month')
->reactive()
->options([
'01' => 'January',
'02' => 'February',
'03' => 'March',
'04' => 'April',
'05' => 'May',
'06' => 'June',
'07' => 'July',
'08' => 'August',
'09' => 'September',
'10' => 'October',
'11' => 'November',
'12' => 'December',
])
->required()
->afterStateUpdated(function ($state, callable $get) {
$plantId = $get('plant_id');
$lineId = $get('line_id');
// $month = $get('month');
$year = $get('year');
$month = (int) $get('month');
if (!$month) {
return;
}
$this->dispatch('loadData', $plantId, $lineId, $month, $year);
}),
])
->columns(4)
]);
}
public function export(){
$plantId = $this->filters['plant_id'] ?? null;
$lineId = $this->filters['line_id'] ?? null;
$year = $this->filters['year'] ?? null;
$month = $this->filters['month'] ?? null;
if (! $plantId) {
Notification::make()
->title('Plant')
->body("please select plant to export data..!")
->danger()
->send();
return;
}
else if (! $lineId) {
Notification::make()
->title('Line')
->body("please select line to export data..!")
->danger()
->send();
return;
}
else if (! $year) {
Notification::make()
->title('Year')
->body("please select year to export data..!")
->danger()
->send();
return;
}
else if (! $month) {
Notification::make()
->title('Month')
->body("please select month to export data..!")
->danger()
->send();
return;
}
$this->dispatch('loadData1' ,$plantId, $lineId, $year, $month);
}
}

View File

@@ -82,9 +82,6 @@ class ItemResource extends Resource
Forms\Components\TextInput::make('category') Forms\Components\TextInput::make('category')
->label('Category') ->label('Category')
->placeholder('Scan the Category'), ->placeholder('Scan the Category'),
Forms\Components\TextInput::make('category')
->label('Category')
->placeholder('Scan the Category'),
Forms\Components\TextInput::make('code') Forms\Components\TextInput::make('code')
->required() ->required()
->placeholder('Scan the valid code') ->placeholder('Scan the valid code')

View File

@@ -5,23 +5,23 @@ namespace App\Filament\Resources;
use App\Filament\Exports\LineExporter; use App\Filament\Exports\LineExporter;
use App\Filament\Imports\LineImporter; use App\Filament\Imports\LineImporter;
use App\Filament\Resources\LineResource\Pages; use App\Filament\Resources\LineResource\Pages;
use App\Models\Block; use App\Filament\Resources\LineResource\RelationManagers;
use App\Models\Line; use App\Models\Line;
use App\Models\Plant; use App\Models\Plant;
use App\Models\WorkGroupMaster; use App\Models\WorkGroupMaster;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\Section;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Forms\Get; use Filament\Forms\Get;
use Filament\Forms\Set;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction; use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Forms\Components\Section;
use Filament\Forms\Set;
use Filament\Tables\Actions\ExportAction;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Unique; use Illuminate\Validation\Rules\Unique;
@@ -48,8 +48,7 @@ class LineResource extends Resource
->reactive() ->reactive()
->options(function (callable $get) { ->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id; $userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
}) })
->default(function () { ->default(function () {
return optional(Line::latest()->first())->plant_id; return optional(Line::latest()->first())->plant_id;
@@ -61,9 +60,10 @@ class LineResource extends Resource
// Ensure `linestop_id` is not cleared // Ensure `linestop_id` is not cleared
if (!$plantId) { if (!$plantId) {
$set('lPlantError', 'Please select a plant first.'); $set('lPlantError', 'Please select a plant first.');
return; return;
} else { }
else
{
$set('lPlantError', null); $set('lPlantError', null);
} }
}) })
@@ -72,39 +72,6 @@ class LineResource extends Resource
]) ])
->hint(fn ($get) => $get('lPlantError') ? $get('lPlantError') : null) ->hint(fn ($get) => $get('lPlantError') ? $get('lPlantError') : null)
->hintColor('danger'), ->hintColor('danger'),
Forms\Components\Select::make('block_id')
->label('Block')
->relationship('block', 'name')
->required()
// ->nullable(),
->reactive()
->options(function (callable $get) {
if (! $get('plant_id')) {
return [];
}
return Block::where('plant_id', $get('plant_id'))
->pluck('name', 'id')
->toArray();
})
->default(function () {
return optional(Block::latest()->first())->plant_id;
})
->afterStateUpdated(function ($state, callable $set, callable $get) {
$blockId = $get('block_id');
if (! $blockId) {
$set('lblockError', 'Please select a Block first.');
return;
} else {
$set('lblockError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('lblockError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('lblockError') ? $get('lblockError') : null)
->hintColor('danger'),
Forms\Components\TextInput::make('name') Forms\Components\TextInput::make('name')
->required() ->required()
->placeholder('Scan the valid name') ->placeholder('Scan the valid name')
@@ -132,9 +99,10 @@ class LineResource extends Resource
// Ensure `linestop_id` is not cleared // Ensure `linestop_id` is not cleared
if (!$lineNam) { if (!$lineNam) {
$set('lNameError', 'Scan the valid name.'); $set('lNameError', 'Scan the valid name.');
return; return;
} else { }
else
{
// $exists = Line::where('name', $lineNam) // $exists = Line::where('name', $lineNam)
// ->where('plant_id', $get('plant_id')) // ->where('plant_id', $get('plant_id'))
// ->exists(); // ->exists();
@@ -188,9 +156,6 @@ class LineResource extends Resource
'Base FG Line' => 'Base FG Line', 'Base FG Line' => 'Base FG Line',
'SFG Line' => 'SFG Line', 'SFG Line' => 'SFG Line',
'FG Line' => 'FG Line', 'FG Line' => 'FG Line',
'Process Base FG Line' => 'Process Base FG Line',
'Process SFG Line' => 'Process SFG Line',
'Process FG Line' => 'Process FG Line',
'Machining Cell' => 'Machining Cell', 'Machining Cell' => 'Machining Cell',
'Blanking Cell' => 'Blanking Cell', 'Blanking Cell' => 'Blanking Cell',
'Forming Cell' => 'Forming Cell', 'Forming Cell' => 'Forming Cell',
@@ -205,9 +170,10 @@ class LineResource extends Resource
// Ensure `linestop_id` is not cleared // Ensure `linestop_id` is not cleared
if (!$lineTyp) { if (!$lineTyp) {
$set('lTypeError', 'Scan the valid type.'); $set('lTypeError', 'Scan the valid type.');
return; return;
} else { }
else
{
$set('lTypeError', null); $set('lTypeError', null);
} }
}) })
@@ -238,7 +204,7 @@ class LineResource extends Resource
$partValidDispColumns = [ $partValidDispColumns = [
'work_group1_actual_id', 'work_group2_actual_id', 'work_group3_actual_id', 'work_group4_actual_id', 'work_group5_actual_id', 'work_group1_actual_id', 'work_group2_actual_id', 'work_group3_actual_id', 'work_group4_actual_id', 'work_group5_actual_id',
'work_group6_actual_id', 'work_group7_actual_id', 'work_group8_actual_id', 'work_group9_actual_id', 'work_group10_actual_id', 'work_group6_actual_id', 'work_group7_actual_id', 'work_group8_actual_id', 'work_group9_actual_id', 'work_group10_actual_id'
]; ];
foreach ($partValidDispColumns as $column) { foreach ($partValidDispColumns as $column) {
@@ -289,7 +255,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group1_id_error', null); $set('work_group1_id_error', null);
$set('work_group1_id', null); $set('work_group1_id', null);
return; return;
} }
@@ -298,7 +263,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group1_id_error', 'Invalid plant name.'); $set('work_group1_id_error', 'Invalid plant name.');
return; return;
} }
@@ -308,7 +272,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group1_id_error', 'Work group does not exist for this plant in master.'); $set('work_group1_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -334,9 +297,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group1_actual_id', ''); $set('work_group1_actual_id', '');
$set('work_group1_id', null); $set('work_group1_id', null);
return; return;
} else { }
else
{
$set('work_group1_id_error', null); $set('work_group1_id_error', null);
$set('work_group1_id', $workGroupRecord->id); $set('work_group1_id', $workGroupRecord->id);
} }
@@ -368,7 +332,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group2_id_error', null); $set('work_group2_id_error', null);
$set('work_group2_id', null); $set('work_group2_id', null);
return; return;
} }
@@ -377,7 +340,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group2_id_error', 'Invalid plant name.'); $set('work_group2_id_error', 'Invalid plant name.');
return; return;
} }
@@ -387,7 +349,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group2_id_error', 'Work group does not exist for this plant in master.'); $set('work_group2_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -408,9 +369,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group2_actual_id', ''); $set('work_group2_actual_id', '');
$set('work_group2_id', null); $set('work_group2_id', null);
return; return;
} else { }
else
{
$set('work_group2_id_error', null); $set('work_group2_id_error', null);
$set('work_group2_id', $workGroupRecord->id); $set('work_group2_id', $workGroupRecord->id);
} }
@@ -442,7 +404,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group3_id_error', null); $set('work_group3_id_error', null);
$set('work_group3_id', null); $set('work_group3_id', null);
return; return;
} }
@@ -451,7 +412,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group3_id_error', 'Invalid plant name.'); $set('work_group3_id_error', 'Invalid plant name.');
return; return;
} }
@@ -461,7 +421,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group3_id_error', 'Work group does not exist for this plant in master.'); $set('work_group3_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -482,9 +441,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group3_actual_id', ''); $set('work_group3_actual_id', '');
$set('work_group3_id', null); $set('work_group3_id', null);
return; return;
} else { }
else
{
$set('work_group3_id_error', null); $set('work_group3_id_error', null);
$set('work_group3_id', $workGroupRecord->id); $set('work_group3_id', $workGroupRecord->id);
} }
@@ -516,7 +476,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group4_id_error', null); $set('work_group4_id_error', null);
$set('work_group4_id', null); $set('work_group4_id', null);
return; return;
} }
@@ -525,7 +484,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group4_id_error', 'Invalid plant name.'); $set('work_group4_id_error', 'Invalid plant name.');
return; return;
} }
@@ -535,7 +493,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group4_id_error', 'Work group does not exist for this plant in master.'); $set('work_group4_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -556,9 +513,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group4_actual_id', ''); $set('work_group4_actual_id', '');
$set('work_group4_id', null); $set('work_group4_id', null);
return; return;
} else { }
else
{
$set('work_group4_id_error', null); $set('work_group4_id_error', null);
$set('work_group4_id', $workGroupRecord->id); $set('work_group4_id', $workGroupRecord->id);
} }
@@ -590,7 +548,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group5_id_error', null); $set('work_group5_id_error', null);
$set('work_group5_id', null); $set('work_group5_id', null);
return; return;
} }
@@ -599,7 +556,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group5_id_error', 'Invalid plant name.'); $set('work_group5_id_error', 'Invalid plant name.');
return; return;
} }
@@ -609,7 +565,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group5_id_error', 'Work group does not exist for this plant in master.'); $set('work_group5_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -630,9 +585,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group5_actual_id', ''); $set('work_group5_actual_id', '');
$set('work_group5_id', null); $set('work_group5_id', null);
return; return;
} else { }
else
{
$set('work_group5_id_error', null); $set('work_group5_id_error', null);
$set('work_group5_id', $workGroupRecord->id); $set('work_group5_id', $workGroupRecord->id);
} }
@@ -664,7 +620,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group6_id_error', null); $set('work_group6_id_error', null);
$set('work_group6_id', null); $set('work_group6_id', null);
return; return;
} }
@@ -673,7 +628,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group6_id_error', 'Invalid plant name.'); $set('work_group6_id_error', 'Invalid plant name.');
return; return;
} }
@@ -683,7 +637,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group6_id_error', 'Work group does not exist for this plant in master.'); $set('work_group6_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -704,9 +657,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group6_actual_id', ''); $set('work_group6_actual_id', '');
$set('work_group6_id', null); $set('work_group6_id', null);
return; return;
} else { }
else
{
$set('work_group6_id_error', null); $set('work_group6_id_error', null);
$set('work_group6_id', $workGroupRecord->id); $set('work_group6_id', $workGroupRecord->id);
} }
@@ -738,7 +692,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group7_id_error', null); $set('work_group7_id_error', null);
$set('work_group7_id', null); $set('work_group7_id', null);
return; return;
} }
@@ -747,7 +700,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group7_id_error', 'Invalid plant name.'); $set('work_group7_id_error', 'Invalid plant name.');
return; return;
} }
@@ -757,7 +709,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group7_id_error', 'Work group does not exist for this plant in master.'); $set('work_group7_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -778,9 +729,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group7_actual_id', ''); $set('work_group7_actual_id', '');
$set('work_group7_id', null); $set('work_group7_id', null);
return; return;
} else { }
else
{
$set('work_group7_id_error', null); $set('work_group7_id_error', null);
$set('work_group7_id', $workGroupRecord->id); $set('work_group7_id', $workGroupRecord->id);
} }
@@ -812,7 +764,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group8_id_error', null); $set('work_group8_id_error', null);
$set('work_group8_id', null); $set('work_group8_id', null);
return; return;
} }
@@ -821,7 +772,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group8_id_error', 'Invalid plant name.'); $set('work_group8_id_error', 'Invalid plant name.');
return; return;
} }
@@ -831,7 +781,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group8_id_error', 'Work group does not exist for this plant in master.'); $set('work_group8_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -852,9 +801,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group8_actual_id', ''); $set('work_group8_actual_id', '');
$set('work_group8_id', null); $set('work_group8_id', null);
return; return;
} else { }
else
{
$set('work_group8_id_error', null); $set('work_group8_id_error', null);
$set('work_group8_id', $workGroupRecord->id); $set('work_group8_id', $workGroupRecord->id);
} }
@@ -886,7 +836,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group9_id_error', null); $set('work_group9_id_error', null);
$set('work_group9_id', null); $set('work_group9_id', null);
return; return;
} }
@@ -895,7 +844,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group9_id_error', 'Invalid plant name.'); $set('work_group9_id_error', 'Invalid plant name.');
return; return;
} }
@@ -905,7 +853,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group9_id_error', 'Work group does not exist for this plant in master.'); $set('work_group9_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -926,9 +873,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group9_actual_id', ''); $set('work_group9_actual_id', '');
$set('work_group9_id', null); $set('work_group9_id', null);
return; return;
} else { }
else
{
$set('work_group9_id_error', null); $set('work_group9_id_error', null);
$set('work_group9_id', $workGroupRecord->id); $set('work_group9_id', $workGroupRecord->id);
} }
@@ -960,7 +908,6 @@ class LineResource extends Resource
if ($state == null || trim($state) == '') { if ($state == null || trim($state) == '') {
$set('work_group10_id_error', null); $set('work_group10_id_error', null);
$set('work_group10_id', null); $set('work_group10_id', null);
return; return;
} }
@@ -969,7 +916,6 @@ class LineResource extends Resource
if (!$plantId) { if (!$plantId) {
$set('work_group10_id_error', 'Invalid plant name.'); $set('work_group10_id_error', 'Invalid plant name.');
return; return;
} }
@@ -979,7 +925,6 @@ class LineResource extends Resource
if (!$workGroupRecord) { if (!$workGroupRecord) {
$set('work_group10_id_error', 'Work group does not exist for this plant in master.'); $set('work_group10_id_error', 'Work group does not exist for this plant in master.');
return; return;
} }
@@ -1000,9 +945,10 @@ class LineResource extends Resource
->send(); ->send();
$set('work_group10_actual_id', ''); $set('work_group10_actual_id', '');
$set('work_group10_id', null); $set('work_group10_id', null);
return; return;
} else { }
else
{
$set('work_group10_id_error', null); $set('work_group10_id_error', null);
$set('work_group10_id', $workGroupRecord->id); $set('work_group10_id', $workGroupRecord->id);
} }
@@ -1038,7 +984,6 @@ class LineResource extends Resource
$paginator = $livewire->getTableRecords(); $paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration; return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}), }),
Tables\Columns\TextColumn::make('plant.name') Tables\Columns\TextColumn::make('plant.name')
@@ -1046,11 +991,6 @@ class LineResource extends Resource
->alignCenter() ->alignCenter()
->sortable() ->sortable()
->searchable(), ->searchable(),
Tables\Columns\TextColumn::make('block.name')
->label('Block')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('name') Tables\Columns\TextColumn::make('name')
->label('Line') ->label('Line')
->alignCenter() ->alignCenter()

View File

@@ -6,8 +6,8 @@ use AlperenErsoy\FilamentExport\Actions\FilamentExportBulkAction;
use App\Filament\Exports\ProductionPlanExporter; use App\Filament\Exports\ProductionPlanExporter;
use App\Filament\Imports\ProductionPlanImporter; use App\Filament\Imports\ProductionPlanImporter;
use App\Filament\Resources\ProductionPlanResource\Pages; use App\Filament\Resources\ProductionPlanResource\Pages;
use App\Filament\Resources\ProductionPlanResource\RelationManagers;
use App\Models\Block; use App\Models\Block;
use App\Models\Item;
use App\Models\Line; use App\Models\Line;
use App\Models\Plant; use App\Models\Plant;
use App\Models\ProductionPlan; use App\Models\ProductionPlan;
@@ -16,18 +16,19 @@ use Carbon\Carbon;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\DateTimePicker; use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Forms\Get; use Filament\Forms\Get;
use Filament\Resources\Resource; use Filament\Resources\Resource;
use Filament\Tables; use Filament\Tables;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Actions\ImportAction; use Filament\Tables\Actions\ImportAction;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Table; use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope; use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Tables\Actions\ExportAction;
use Filament\Tables\Filters\Filter;
use Illuminate\Support\Facades\Request;
class ProductionPlanResource extends Resource class ProductionPlanResource extends Resource
{ {
@@ -54,8 +55,7 @@ class ProductionPlanResource extends Resource
->reactive() ->reactive()
->options(function (callable $get) { ->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id; $userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
}) })
->default(function () { ->default(function () {
return optional(ProductionPlan::latest()->first())->plant_id; return optional(ProductionPlan::latest()->first())->plant_id;
@@ -67,9 +67,10 @@ class ProductionPlanResource extends Resource
$set('block_name', null); $set('block_name', null);
if (!$plantId) { if (!$plantId) {
$set('ppPlantError', 'Please select a plant first.'); $set('ppPlantError', 'Please select a plant first.');
return; return;
} else { }
else
{
$set('ppPlantError', null); $set('ppPlantError', null);
} }
}) })
@@ -78,6 +79,102 @@ class ProductionPlanResource extends Resource
]) ])
->hint(fn ($get) => $get('ppPlantError') ? $get('ppPlantError') : null) ->hint(fn ($get) => $get('ppPlantError') ? $get('ppPlantError') : null)
->hintColor('danger'), ->hintColor('danger'),
Forms\Components\Select::make('block_name')
->required()
// ->nullable()
->label('Block')
->options(function (callable $get) {
if (!$get('plant_id')) {
return [];
}
return Block::where('plant_id', $get('plant_id'))
->pluck('name', 'id')
->toArray();
})
->reactive()
->default(function () {
$latestShiftId = optional(ProductionPlan::latest()->first())->shift_id;
return optional(Shift::where('id', $latestShiftId)->first())->block_id;
})
//->afterStateUpdated(fn ($set) => $set('shift_id', null))
->afterStateUpdated(function ($state, callable $set, callable $get) {
if($get('id'))
{
$getShift = ProductionPlan::where('id', $get('id'))->first();
$getBlock = Shift::where('id', $getShift->shift_id)->first();
if($getBlock->block_id)
{
$set('block_name', $getBlock->block_id);
$set('ppBlockError', null);
}
}
$blockId = $get('block_name');
$set('shift_id', null);
if (!$blockId) {
$set('ppBlockError', 'Please select a block first.');
return;
}
else
{
$set('ppBlockError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('ppBlockError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('ppBlockError') ? $get('ppBlockError') : null)
->hintColor('danger'),
Forms\Components\Select::make('shift_id')
->relationship('shift', 'name')
->required()
// ->nullable()
->autofocus(true)
->options(function (callable $get) {
if (!$get('plant_id') || !$get('block_name')) {
return [];
}
return Shift::where('plant_id', $get('plant_id'))
->where('block_id', $get('block_name'))
->pluck('name', 'id')
->toArray();
})
->reactive()
->default(function () {
return optional(ProductionPlan::latest()->first())->shift_id;
})
// ->afterStateUpdated(fn ($set) => $set('line_id', null))
->afterStateUpdated(function ($state, callable $set, callable $get) {
if($get('id'))
{
$getShift = ProductionPlan::where('id', $get('id'))->first();
if($getShift->shift_id)
{
$set('shift_id', $getShift->shift_id);
$set('ppShiftError', null);
}
}
$curShiftId = $get('shift_id');
$set('line_id', null);
if (!$curShiftId) {
$set('ppShiftError', 'Please select a shift first.');
return;
}
else
{
$set('ppShiftError', null);
}
})
->extraAttributes(fn ($get) => [
'class' => $get('ppShiftError') ? 'border-red-500' : '',
])
->hint(fn ($get) => $get('ppShiftError') ? $get('ppShiftError') : null)
->hintColor('danger'),
Forms\Components\Select::make('line_id') Forms\Components\Select::make('line_id')
->relationship('line', 'name') ->relationship('line', 'name')
->required() ->required()
@@ -88,7 +185,7 @@ class ProductionPlanResource extends Resource
// ->toArray() // Convert collection to array // ->toArray() // Convert collection to array
// ) // )
->options(function (callable $get) { ->options(function (callable $get) {
if (! $get('plant_id')) { if (!$get('plant_id') || !$get('block_name') || !$get('shift_id')) {
return []; return [];
} }
@@ -100,54 +197,207 @@ class ProductionPlanResource extends Resource
// ->default(function () { // ->default(function () {
// return optional(ProductionPlan::latest()->first())->line_id; // return optional(ProductionPlan::latest()->first())->line_id;
// }) // })
// ->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
// if ($get('id')) { if($get('id'))
// $getShift = ProductionPlan::where('id', $get('id'))->first(); {
// if ($getShift->line_id) { $getShift = ProductionPlan::where('id', $get('id'))->first();
// $set('line_id', $getShift->line_id); if($getShift->line_id)
// $set('ppLineError', null); {
// } $set('line_id', $getShift->line_id);
// } else { $set('ppLineError', null);
// $currentDT = Carbon::now()->toDateTimeString(); }
// $set('created_at', $currentDT); }
// $set('update_date', null); else
// } {
$currentDT = Carbon::now()->toDateTimeString();
$set('created_at', $currentDT);
$set('update_date', null);
}
// $lineId = $get('line_id'); $lineId = $get('line_id');
// // $set('plan_quantity', null); // $set('plan_quantity', null);
// if (! $lineId) { if (!$lineId) {
// $set('ppLineError', 'Please select a line first.'); $set('ppLineError', 'Please select a line first.');
return;
}
else
{
$isUpdate = !empty($get('id'));
if (!$isUpdate)
{
$exists = ProductionPlan::where('plant_id', $get('plant_id'))
->where('shift_id', $get('shift_id'))
->where('line_id', $get('line_id'))
->whereDate('created_at', today())
->latest()
->exists();
if ($exists)
{
$set('line_id', null);
$set('ppLineError', 'Production plan already updated.');
return;
}
else
{
$existShifts = ProductionPlan::where('plant_id', $get('plant_id'))
->where('shift_id', $get('shift_id'))
->where('line_id', $get('line_id'))
->whereDate('created_at', Carbon::yesterday())
->latest()
->exists();
if ($existShifts) //if ($existShifts->count() > 0)
{
//$currentDate = date('Y-m-d');
$yesterday = date('Y-m-d', strtotime('-1 days'));
$shiftId = Shift::where('id', $get('shift_id'))
->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
$from_dt = $yesterday . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
//echo "Choosed a valid shift...";
$set('line_id', null);
$set('ppLineError', 'Production plan already updated.');
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
else
{
$currentDate = date('Y-m-d');
$shiftId = Shift::where('id', $get('shift_id'))
->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
$from_dt = $currentDate . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if (!($currentDateTime >= $from_dt && $currentDateTime < $to_dt)) {
//echo "Choosed a valid shift...";
$set('line_id', null);
$set('ppLineError', 'Choosed a invalid shift.');
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
}
$set('ppLineError', null);
return;
}
else
{
//$currentDate = date('Y-m-d');
$yesterday = date('Y-m-d', strtotime('-1 days'));
$shiftId = Shift::where('id', $get('shift_id'))
->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
$from_dt = $yesterday . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
//echo "Choosed a valid shift...";
// here i'm updating created as yesterday
$set('created_at', $from_dt);
$set('update_date', '1');
$set('ppLineError', null);
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
else
{
$currentDate = date('Y-m-d');
$shiftId = Shift::where('id', $get('shift_id'))
->first();
[$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
$hRs = (int) $hRs;
// $miNs = (int) $miNs;-*/
$totalMinutes = $hRs * 60 + $miNs;
$from_dt = $currentDate . ' ' . $shiftId->start_time;
$to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
$currentDateTime = date('Y-m-d H:i:s');
// Check if current date time is within the range
if (!($currentDateTime >= $from_dt && $currentDateTime < $to_dt)) {
//echo "Choosed a valid shift...";
$set('line_id', null);
$set('ppLineError', 'Choosed a invalid shift.');
// $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
return;
}
}
$set('ppLineError', null);
return;
}
// return;
// } else {
// $isUpdate = ! empty($get('id'));
// if (! $isUpdate) {
// $exists = ProductionPlan::where('plant_id', $get('plant_id')) // $exists = ProductionPlan::where('plant_id', $get('plant_id'))
// ->where('shift_id', $get('shift_id')) // //->where('shift_id', $get('shift_id'))
// ->where('line_id', $get('line_id')) // ->where('line_id', $get('line_id'))
// ->whereDate('created_at', today()) // ->whereDate('created_at', today())
// ->latest() // ->latest() // Orders by created_at DESC
// ->exists(); // ->first();
// if ($exists) { // if ($exists)
// $set('line_id', null); // {
// $set('ppLineError', 'Production plan already updated.'); // $existingShifts = ProductionPlan::where('plant_id', $get('plant_id'))
// //->where('shift_id', $get('shift_id'))
// return;
// } else {
// $existShifts = ProductionPlan::where('plant_id', $get('plant_id'))
// ->where('shift_id', $get('shift_id'))
// ->where('line_id', $get('line_id')) // ->where('line_id', $get('line_id'))
// ->whereDate('created_at', Carbon::yesterday()) // // ->whereDate('created_at', today())
// ->latest() // ->whereDate('created_at', today())
// ->exists(); // ->get();
// if ($existShifts) { // if ($existShifts->count() > 0) // foreach ($existingShifts as $shift) {
// // $currentDate = date('Y-m-d'); // $curShiftId = $shift->shift_id;
// $yesterday = date('Y-m-d', strtotime('-1 days'));
// $shiftId = Shift::where('id', $get('shift_id')) // $currentDate = date('Y-m-d');
// $shiftId = \App\Models\Shift::where('id', $curShiftId)
// ->first(); // ->first();
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0]; // [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
@@ -156,7 +406,7 @@ class ProductionPlanResource extends Resource
// $totalMinutes = $hRs * 60 + $miNs; // $totalMinutes = $hRs * 60 + $miNs;
// $from_dt = $yesterday.' '.$shiftId->start_time; // $from_dt = $currentDate . ' ' . $shiftId->start_time;
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes")); // $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
@@ -165,192 +415,30 @@ class ProductionPlanResource extends Resource
// // Check if current date time is within the range // // Check if current date time is within the range
// if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) { // if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// //echo "Choosed a valid shift..."; // //echo "Choosed a valid shift...";
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// $set('line_id', null); // $set('line_id', null);
// $set('ppLineError', 'Production plan already updated.'); // $set('ppLineError', 'Production plan already updated.');
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// } else {
// $currentDate = date('Y-m-d');
// $shiftId = Shift::where('id', $get('shift_id'))
// ->first();
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
// $totalMinutes = $hRs * 60 + $miNs;
// $from_dt = $currentDate.' '.$shiftId->start_time;
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt." + $totalMinutes minutes"));
// $currentDateTime = date('Y-m-d H:i:s');
// // Check if current date time is within the range
// if (! ($currentDateTime >= $from_dt && $currentDateTime < $to_dt)) {
// // echo "Choosed a valid shift...";
// $set('line_id', null);
// $set('ppLineError', 'Choosed a invalid shift.');
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// return; // return;
// } // }
// } // // else {
// // $set('ppLineError', 'Choosed a invalid shift...');
// $set('ppLineError', null);
// return;
// } else {
// // $currentDate = date('Y-m-d');
// $yesterday = date('Y-m-d', strtotime('-1 days'));
// $shiftId = Shift::where('id', $get('shift_id'))
// ->first();
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
// $totalMinutes = $hRs * 60 + $miNs;
// $from_dt = $yesterday.' '.$shiftId->start_time;
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt." + $totalMinutes minutes"));
// $currentDateTime = date('Y-m-d H:i:s');
// // Check if current date time is within the range
// if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// // echo "Choosed a valid shift...";
// // here i'm updating created as yesterday
// $set('created_at', $from_dt);
// $set('update_date', '1');
// $set('ppLineError', null);
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// } else {
// $currentDate = date('Y-m-d');
// $shiftId = Shift::where('id', $get('shift_id'))
// ->first();
// [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// $hRs = (int) $hRs;
// // $miNs = (int) $miNs;-*/
// $totalMinutes = $hRs * 60 + $miNs;
// $from_dt = $currentDate.' '.$shiftId->start_time;
// $to_dt = date('Y-m-d H:i:s', strtotime($from_dt." + $totalMinutes minutes"));
// $currentDateTime = date('Y-m-d H:i:s');
// // Check if current date time is within the range
// if (! ($currentDateTime >= $from_dt && $currentDateTime < $to_dt)) {
// // echo "Choosed a valid shift...";
// $set('line_id', null);
// $set('ppLineError', 'Choosed a invalid shift.');
// // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// return;
// }
// }
// $set('ppLineError', null);
// return;
// }
// // $exists = ProductionPlan::where('plant_id', $get('plant_id'))
// // //->where('shift_id', $get('shift_id'))
// // ->where('line_id', $get('line_id'))
// // ->whereDate('created_at', today())
// // ->latest() // Orders by created_at DESC
// // ->first();
// // if ($exists)
// // {
// // $existingShifts = ProductionPlan::where('plant_id', $get('plant_id'))
// // //->where('shift_id', $get('shift_id'))
// // ->where('line_id', $get('line_id'))
// // // ->whereDate('created_at', today())
// // ->whereDate('created_at', today())
// // ->get();
// // foreach ($existingShifts as $shift) {
// // $curShiftId = $shift->shift_id;
// // $currentDate = date('Y-m-d');
// // $shiftId = \App\Models\Shift::where('id', $curShiftId)
// // ->first();
// // [$hRs, $miNs] = explode('.', $shiftId->duration) + [0, 0];
// // $hRs = (int) $hRs;
// // // $miNs = (int) $miNs;-*/
// // $totalMinutes = $hRs * 60 + $miNs;
// // $from_dt = $currentDate . ' ' . $shiftId->start_time;
// // $to_dt = date('Y-m-d H:i:s', strtotime($from_dt . " + $totalMinutes minutes"));
// // $currentDateTime = date('Y-m-d H:i:s');
// // // Check if current date time is within the range
// // if ($currentDateTime >= $from_dt && $currentDateTime < $to_dt) {
// // //echo "Choosed a valid shift...";
// // // $set('ppLineError', 'Valid (From: '.$from_dt.', To: '.$to_dt.')');
// // $set('line_id', null);
// // $set('ppLineError', 'Production plan already updated.');
// // return;
// // }
// // // else {
// // // $set('ppLineError', 'Choosed a invalid shift...');
// // // return;
// // // }
// // }
// // $set('ppLineError', null);
// // return; // // return;
// // } // // }
// } // }
// }
// $set('ppLineError', null); // $set('ppLineError', null);
// return;
// } // }
// }) }
->afterStateUpdated(function ($state, callable $set, callable $get) { }
$set('item_id', null); $set('ppLineError', null);
$set('plan_quantity', null); }
}) })
->extraAttributes(fn ($get) => [ ->extraAttributes(fn ($get) => [
'class' => $get('ppLineError') ? 'border-red-500' : '', 'class' => $get('ppLineError') ? 'border-red-500' : '',
]) ])
->hint(fn ($get) => $get('ppLineError') ? $get('ppLineError') : null) ->hint(fn ($get) => $get('ppLineError') ? $get('ppLineError') : null)
->hintColor('danger'), ->hintColor('danger'),
Forms\Components\Select::make('item_id')
->label('Item')
->reactive()
->searchable()
->required()
->options(function (callable $get) {
if (! $get('plant_id')) {
return [];
}
return Item::where('plant_id', $get('plant_id'))
->pluck('code', 'id')
->toArray();
}),
Forms\Components\TextInput::make('plan_quantity') Forms\Components\TextInput::make('plan_quantity')
->required() ->required()
->integer() ->integer()
@@ -361,8 +449,10 @@ class ProductionPlanResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
$planQuan = $get('plan_quantity'); $planQuan = $get('plan_quantity');
if (! $get('update_date')) { if(!$get('update_date') )
if (! $get('id')) { {
if(!$get('id'))
{
$currentDT = Carbon::now()->toDateTimeString(); $currentDT = Carbon::now()->toDateTimeString();
$set('created_at', $currentDT); $set('created_at', $currentDT);
} }
@@ -370,9 +460,10 @@ class ProductionPlanResource extends Resource
if (!$planQuan) { if (!$planQuan) {
$set('ppPlanQuanError', 'Scan the valid plan quantity.'); $set('ppPlanQuanError', 'Scan the valid plan quantity.');
return; return;
} else { }
else
{
$set('ppPlanQuanError', null); $set('ppPlanQuanError', null);
} }
}) })
@@ -381,19 +472,29 @@ class ProductionPlanResource extends Resource
]) ])
->hint(fn ($get) => $get('ppPlanQuanError') ? $get('ppPlanQuanError') : null) ->hint(fn ($get) => $get('ppPlanQuanError') ? $get('ppPlanQuanError') : null)
->hintColor('danger'), ->hintColor('danger'),
// Forms\Components\TextInput::make('production_quantity') Forms\Components\TextInput::make('production_quantity')
// ->required() ->required()
// ->integer() ->integer()
// ->label('Production Quantity') ->label('Production Quantity')
// ->readOnly(fn (callable $get) => ! $get('id')) ->readOnly(fn (callable $get) => !$get('id'))
// ->default(0), ->default(0),
Forms\Components\TextInput::make('id') Forms\Components\TextInput::make('id')
->hidden() ->hidden()
->readOnly(), ->readOnly(),
Forms\Components\TextInput::make('update_date')
->hidden()
->reactive()
->readOnly(),
Forms\Components\DateTimePicker::make('created_at')
->label('Created DateTime')
->hidden()
->reactive()
->required()
->readOnly(),
Forms\Components\Hidden::make('operator_id') Forms\Components\Hidden::make('operator_id')
->default(Filament::auth()->user()->name), ->default(Filament::auth()->user()->name),
]) ])
->columns(4), ->columns(2),
]); ]);
} }
@@ -428,55 +529,34 @@ class ProductionPlanResource extends Resource
$paginator = $livewire->getTableRecords(); $paginator = $livewire->getTableRecords();
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10; $perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1; $currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
return ($currentPage - 1) * $perPage + $rowLoop->iteration; return ($currentPage - 1) * $perPage + $rowLoop->iteration;
}), }),
Tables\Columns\TextColumn::make('plant.name')
->label('Plant')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('line.name')
->label('Plant')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('item.code')
->label('Item')
->alignCenter()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('plan_quantity') Tables\Columns\TextColumn::make('plan_quantity')
->label('Plan Quantity') ->label('Plan Quantity')
->alignCenter() ->alignCenter()
->numeric() ->numeric()
->sortable() ->sortable(),
->searchable(),
Tables\Columns\TextColumn::make('working_days')
->label('Working Days')
->alignCenter()
->numeric()
->sortable()
->searchable(),
Tables\Columns\TextColumn::make('production_quantity') Tables\Columns\TextColumn::make('production_quantity')
->label('Production Quantity') ->label('Production Quantity')
->alignCenter() ->alignCenter()
->numeric() ->numeric()
->sortable() ->sortable(),
->searchable(), Tables\Columns\TextColumn::make('line.name')
// Tables\Columns\TextColumn::make('line.name') ->label('Line')
// ->label('Line') ->alignCenter()
// ->alignCenter() ->sortable(),// ->searchable(),
// ->sortable(), // ->searchable(), Tables\Columns\TextColumn::make('shift.block.name')
// Tables\Columns\TextColumn::make('shift.block.name') ->label('Block')
// ->label('Block') ->alignCenter()
// ->alignCenter() ->sortable(),
// ->sortable(), Tables\Columns\TextColumn::make('shift.name')
// Tables\Columns\TextColumn::make('shift.name') ->label('Shift')
// ->label('Shift') ->alignCenter()
// ->alignCenter() ->sortable(),// ->searchable(),
// ->sortable(), // ->searchable(), Tables\Columns\TextColumn::make('plant.name')
->label('Plant')
->alignCenter()
->sortable(),// ->searchable(),
Tables\Columns\TextColumn::make('created_at') Tables\Columns\TextColumn::make('created_at')
->label('Created At') ->label('Created At')
->dateTime() ->dateTime()
@@ -513,8 +593,7 @@ class ProductionPlanResource extends Resource
// }) // })
->options(function (callable $get) { ->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id; $userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
}) })
->reactive() ->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) { ->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -533,7 +612,6 @@ class ProductionPlanResource extends Resource
if (!$plantId ) { if (!$plantId ) {
return []; return [];
} }
return Line::where('plant_id', $plantId) return Line::where('plant_id', $plantId)
->pluck('name', 'id'); ->pluck('name', 'id');
}) })
@@ -549,7 +627,6 @@ class ProductionPlanResource extends Resource
if (!$plantId ) { if (!$plantId ) {
return []; return [];
} }
return Block::where('plant_id', $get('Plant'))->pluck('name', 'id'); return Block::where('plant_id', $get('Plant'))->pluck('name', 'id');
}) })
->reactive() ->reactive()
@@ -592,33 +669,25 @@ class ProductionPlanResource extends Resource
return $query->whereRaw('1 = 0'); return $query->whereRaw('1 = 0');
} }
if (! empty($data['Plant'])) {// if ($plant = $data['Plant'] ?? null) { if ($plant = $data['Plant'] ?? null) {
$query->where('plant_id', $data['Plant']); $query->where('plant_id', $plant);
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return $query->whereRaw('1 = 0');
}
} }
if (! empty($data['Shift'])) {// if ($shift = $data['Shift'] ?? null) { if ($shift = $data['Shift'] ?? null) {
$query->where('shift_id', $data['Shift']); $query->where('shift_id', $shift);
} }
if ($line = $data['Line'] ?? null) {
if (! empty($data['Line'])) {// if ($line = $data['Line'] ?? null) { $query->where('line_id', $line);
$query->where('line_id', $data['Line']);
} }
if (! empty($data['created_from'])) {// if ($from = $data['created_from'] ?? null) { if ($from = $data['created_from'] ?? null) {
$query->where('created_at', '>=', $data['created_from']); $query->where('created_at', '>=', $from);
} }
if (! empty($data['created_to'])) {// if ($to = $data['created_to'] ?? null) { if ($to = $data['created_to'] ?? null) {
$query->where('created_at', '<=', $data['created_to']); $query->where('created_at', '<=', $to);
} }
return $query; return $query;
}) })
->indicateUsing(function (array $data) { ->indicateUsing(function (array $data) {
@@ -626,12 +695,6 @@ class ProductionPlanResource extends Resource
if (!empty($data['Plant'])) { if (!empty($data['Plant'])) {
$indicators[] = 'Plant: ' . Plant::where('id', $data['Plant'])->value('name'); $indicators[] = 'Plant: ' . Plant::where('id', $data['Plant'])->value('name');
} else {
$userHas = Filament::auth()->user()->plant_id;
if ($userHas && strlen($userHas) > 0) {
return 'Plant: Choose plant to filter records.';
}
} }
if (!empty($data['Shift'])) { if (!empty($data['Shift'])) {
@@ -651,7 +714,7 @@ class ProductionPlanResource extends Resource
} }
return $indicators; return $indicators;
}), })
]) ])
->filtersFormMaxHeight('280px') ->filtersFormMaxHeight('280px')
->actions([ ->actions([
@@ -663,7 +726,7 @@ class ProductionPlanResource extends Resource
Tables\Actions\DeleteBulkAction::make(), Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(), Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(), Tables\Actions\RestoreBulkAction::make(),
FilamentExportBulkAction::make('export'), FilamentExportBulkAction::make('export')
]), ]),
]) ])
->headerActions([ ->headerActions([

View File

@@ -3,7 +3,6 @@
namespace App\Filament\Resources\RfqTransporterBidResource\Pages; namespace App\Filament\Resources\RfqTransporterBidResource\Pages;
use App\Filament\Resources\RfqTransporterBidResource; use App\Filament\Resources\RfqTransporterBidResource;
use App\Models\RequestQuotation;
use App\Models\RfqTransporterBid; use App\Models\RfqTransporterBid;
use App\Models\SpotRateTransportMaster; use App\Models\SpotRateTransportMaster;
use App\Models\User; use App\Models\User;
@@ -12,7 +11,6 @@ use Filament\Actions;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord; use Filament\Resources\Pages\EditRecord;
use Illuminate\Support\Facades\Log;
class EditRfqTransporterBid extends EditRecord class EditRfqTransporterBid extends EditRecord
{ {
@@ -24,39 +22,26 @@ class EditRfqTransporterBid extends EditRecord
return; return;
} }
// dd($this->record);
$rank = RfqTransporterBid::where('request_quotation_id', $this->record->request_quotation_id) $rank = RfqTransporterBid::where('request_quotation_id', $this->record->request_quotation_id)
->where('spot_rate_transport_master_id', $this->record->spot_rate_transport_master_id)
->orderBy('total_freight_charge') ->orderBy('total_freight_charge')
->pluck('id') ->pluck('id')
->search($this->record->id) + 1; ->search($this->record->id) + 1;
$requestQuotation = RequestQuotation::findOrFail( $spotRate = SpotRateTransportMaster::findOrFail(
$this->record->request_quotation_id $this->record->spot_rate_transport_master_id
); );
$spotRateId = $requestQuotation->spot_rate_transport_master_id; $userNames = json_decode($spotRate->user_name, true);
$spotRate = SpotRateTransportMaster::findOrFail($spotRateId);
$userNames = $spotRate->user_name;
Log::info('User names from spot rate', [
'user_name_raw' => $spotRate->user_name,
]);
if (!is_array($userNames)) { if (!is_array($userNames)) {
Log::warning('user_name is not array, resetting', [
'user_name' => $userNames,
]);
$userNames = []; $userNames = [];
} }
$users = User::whereIn('name', $userNames)->get(); $users = User::whereIn('name', $userNames)->get();
Log::info('Matched users', [
'count' => $users->count(),
'user_ids' => $users->pluck('id'),
]);
// $recipients = User::role(['Super Admin', 'Rfq Supervisor', 'TransporterBid Employee'])->get(); // $recipients = User::role(['Super Admin', 'Rfq Supervisor', 'TransporterBid Employee'])->get();
@@ -75,8 +60,7 @@ class EditRfqTransporterBid extends EditRecord
// $user1 = Filament::auth()->user(); // $user1 = Filament::auth()->user();
$rfqNumber = $this->record->requestQuotation->rfq_number; $body = "{$currentUser->name} current rank is #{$rank}";
$body = "{$currentUser->name} has updated the bid for RFQ No '{$rfqNumber}'. The current rank is #{$rank}.";
// Notification::make() // Notification::make()
// ->title('Rank Updated') // ->title('Rank Updated')
@@ -91,7 +75,7 @@ class EditRfqTransporterBid extends EditRecord
Notification::make() Notification::make()
->title('Rank Updated') ->title('Rank Updated')
->body("{$currentUser->name} has updated the bid for RFQ No '{$rfqNumber}'. The current rank is #{$rank}.") ->body("{$currentUser->name} current rank is #{$rank}")
->success() ->success()
->sendToDatabase($users); ->sendToDatabase($users);
@@ -104,61 +88,16 @@ class EditRfqTransporterBid extends EditRecord
// ); // );
// } // }
// foreach ($users as $user) {
// Log::info('Checking push subscription for user', [
// 'user_id' => $user->id,
// 'name' => $user->name,
// 'subscription_count' => $user->pushSubscriptions()->count(),
// ]);
// if ($user->pushSubscriptions()->exists()) {
// Log::info('Sending push notification', [
// 'user_id' => $user->id,
// ]);
// $user->notify(
// new PushAlertNotification(
// 'Rank Updated',
// $body
// )
// );
// }
// else {
// Log::warning('User has NO push subscription', [
// 'user_id' => $user->id,
// ]);
// }
// }
foreach ($users as $user) { foreach ($users as $user) {
if ($user->pushSubscriptions()->exists()) {
$count = $user->pushSubscriptions()->count(); $user->notify(
new PushAlertNotification(
Log::info('Checking push subscription for user', [
'user_id' => $user->id,
'name' => $user->name,
'subscription_count' => $count,
]);
if ($count == 0) {
Log::warning('User has NO push subscription', [
'user_id' => $user->id,
]);
continue;
}
Log::info('Sending push notification', [
'user_id' => $user->id,
]);
// ✅ THIS IS ALL YOU NEED
$user->notify(new PushAlertNotification(
'Rank Updated', 'Rank Updated',
$body $body
)); )
);
}
} }
} }

View File

@@ -1,236 +0,0 @@
<?php
namespace App\Livewire;
use App\Exports\ProductionPlanExport;
use App\Models\ProductionPlan;
use App\Models\ProductionQuantity;
use Livewire\Component;
use Carbon\Carbon;
use DB;
use Maatwebsite\Excel\Facades\Excel;
class ProductionTargetPlan extends Component
{
public $plantId, $lineId, $month, $year;
public $records = [];
public $dates = [];
public $leaveDates = [];
public $productionPlanDates = '';
protected $listeners = [
'loadData' => 'loadProductionData',
'loadData1' => 'exportProductionData',
];
public function getMonthDates($month, $year)
{
$start = Carbon::createFromDate($year, $month, 1);
$days = $start->daysInMonth;
$dates = [];
for ($i = 1; $i <= $days; $i++) {
$dates[] = Carbon::createFromDate($year, $month, $i)
->format('Y-m-d');
}
return $dates;
}
public function loadProductionData($plantId, $lineId, $month, $year){
if (!$plantId || !$lineId || !$month || !$year) {
$this->records = [];
$this->dates = [];
$this->leaveDates = [];
return;
}
$this->dates = $this->getMonthDates($month, $year);
$data = ProductionPlan::query()
->join('items', 'items.id', '=', 'production_plans.item_id')
->join('lines', 'lines.id', '=', 'production_plans.line_id')
->join('plants', 'plants.id', '=', 'production_plans.plant_id')
->where('production_plans.plant_id', $plantId)
->where('production_plans.line_id', $lineId)
->whereMonth('production_plans.created_at', $month)
->whereYear('production_plans.created_at', $year)
->select(
'production_plans.created_at',
'production_plans.operator_id',
'plants.name as plant',
'items.code as item_code',
'items.description as item_description',
'lines.name as line_name',
'production_plans.leave_dates'
)
->first();
if ($data && $data->leave_dates) {
$this->leaveDates = array_map('trim', explode(',', $data->leave_dates));
}
$producedData = ProductionQuantity::selectRaw("
plant_id,
line_id,
item_id,
DATE(created_at) as prod_date,
COUNT(*) as total_qty
")
->where('plant_id', $plantId)
->where('line_id', $lineId)
->whereMonth('created_at', $month)
->whereYear('created_at', $year)
->groupBy('plant_id', 'line_id', 'item_id', DB::raw('DATE(created_at)'))
->get()
->groupBy(function ($row) {
return $row->plant_id . '_' . $row->line_id . '_' . $row->item_id;
})
->map(function ($group) {
return $group->keyBy('prod_date');
});
$this->records = ProductionPlan::query()
->join('items', 'items.id', '=', 'production_plans.item_id')
->join('lines', 'lines.id', '=', 'production_plans.line_id')
->join('plants', 'plants.id', '=', 'production_plans.plant_id')
->where('production_plans.plant_id', $plantId)
->where('production_plans.line_id', $lineId)
->whereMonth('production_plans.created_at', $month)
->whereYear('production_plans.created_at', $year)
->select(
'production_plans.item_id',
'production_plans.plant_id',
'production_plans.line_id',
'production_plans.plan_quantity',
'production_plans.working_days',
'items.code as item_code',
'items.description as item_description',
'lines.name as line_name',
'plants.name as plant_name'
)
->get()
// ->map(function ($row) use ($producedData) {
// $row = $row->toArray();
// $row['daily_target'] = ($row['working_days'] > 0)
// ? round($row['plan_quantity'] / $row['working_days'], 2)
// : 0;
// // $key = $row['plant_id'].'_'.$row['line_id'].'_'.$row['item_id'];
// // foreach ($this->dates as $date) {
// // $found = $producedData[$key][$date] ?? null;
// // $row['produced_quantity'][$date] = $found->total_qty ?? 0;
// // }
// $remainingDays = $row['working_days'];
// $pendingQty = 0;
// $row['daily_target_dynamic'] = [];
// $row['produced_quantity'] = [];
// $key = $row['plant_id'].'_'.$row['line_id'].'_'.$row['item_id'];
// foreach ($this->dates as $date) {
// $found = $producedData[$key][$date] ?? null;
// $producedQty = $found->total_qty ?? 0;
// // today's adjusted target
// $todayTarget = $baseDailyTarget;
// if ($remainingDays > 1 && $pendingQty > 0) {
// $todayTarget += $pendingQty / $remainingDays;
// }
// $row['daily_target_dynamic'][$date] = round($todayTarget, 2);
// $row['produced_quantity'][$date] = $producedQty;
// // calculate today's shortfall
// $pendingQty += ($todayTarget - $producedQty);
// if ($pendingQty < 0) {
// $pendingQty = 0;
// }
// $remainingDays--;
// }
// return $row;
// })
->map(function ($row) use ($producedData) {
$row = $row->toArray();
$remainingQty = $row['plan_quantity'];
$remainingDays = $row['working_days'];
$row['daily_target_dynamic'] = [];
$row['produced_quantity'] = [];
$key = $row['plant_id'].'_'.$row['line_id'].'_'.$row['item_id'];
foreach ($this->dates as $date) {
// Skip leave dates
if (in_array($date, $this->leaveDates)) {
$row['daily_target_dynamic'][$date] = '-';
$row['produced_quantity'][$date] = '-';
continue;
}
$todayTarget = $remainingDays > 0
? round($remainingQty / $remainingDays, 2)
: 0;
//$todayTarget = $remainingDays > 0
// ? $remainingQty / $remainingDays
// : 0;
$producedQty = isset($producedData[$key][$date])
? $producedData[$key][$date]->total_qty
: 0;
$row['daily_target_dynamic'][$date] = $todayTarget;
$row['produced_quantity'][$date] = $producedQty;
// Carry forward pending
$remainingQty -= $producedQty;
if ($remainingQty < 0) {
$remainingQty = 0;
}
$remainingDays--;
}
return $row;
})
->toArray();
}
public function exportProductionData()
{
return Excel::download(
new ProductionPlanExport($this->records, $this->dates),
'production_plan_data.xlsx'
);
}
public function render()
{
// return view('livewire.production-target-plan');
return view('livewire.production-target-plan', [
'records' => $this->records,
'dates' => $this->dates,
]);
}
}

View File

@@ -12,13 +12,11 @@ class Item extends Model
protected $fillable = [ protected $fillable = [
'plant_id', 'plant_id',
'line_id',
'category', 'category',
'code', 'code',
'description', 'description',
'hourly_quantity', 'hourly_quantity',
'uom', 'uom',
'line_capacity',
]; ];
public function plant(): BelongsTo public function plant(): BelongsTo
@@ -26,11 +24,6 @@ class Item extends Model
return $this->belongsTo(Plant::class); return $this->belongsTo(Plant::class);
} }
public function line(): BelongsTo
{
return $this->belongsTo(Line::class);
}
public function stickerMasters() public function stickerMasters()
{ {
return $this->hasMany(StickerMaster::class, 'item_id', 'id'); return $this->hasMany(StickerMaster::class, 'item_id', 'id');

View File

@@ -13,7 +13,6 @@ class Line extends Model
protected $fillable = [ protected $fillable = [
"plant_id", "plant_id",
"block_id",
"name", "name",
"type", "type",
"group_work_center", "group_work_center",
@@ -35,11 +34,6 @@ class Line extends Model
return $this->belongsTo(Plant::class); return $this->belongsTo(Plant::class);
} }
public function block(): BelongsTo
{
return $this->belongsTo(Block::class);
}
public function testingPanelReadings() public function testingPanelReadings()
{ {
return $this->hasMany(TestingPanelReading::class); return $this->hasMany(TestingPanelReading::class);

View File

@@ -12,15 +12,12 @@ class ProductionPlan extends Model
protected $fillable = [ protected $fillable = [
"plant_id", "plant_id",
"item_id",
"shift_id", "shift_id",
"created_at", "created_at",
"line_id", "line_id",
"plan_quantity", "plan_quantity",
"production_quantity", "production_quantity",
"operator_id", "operator_id",
"working_days",
"leave_dates",
]; ];
public function plant(): BelongsTo public function plant(): BelongsTo
@@ -37,9 +34,4 @@ class ProductionPlan extends Model
{ {
return $this->belongsTo(Line::class); return $this->belongsTo(Line::class);
} }
public function item(): BelongsTo
{
return $this->belongsTo(Item::class);
}
} }

View File

@@ -16,7 +16,6 @@ class ProductionQuantity extends Model
protected $fillable = [ protected $fillable = [
"plant_id", "plant_id",
"machine_id",
"shift_id", "shift_id",
"line_id", "line_id",
"item_id", "item_id",
@@ -51,11 +50,6 @@ class ProductionQuantity extends Model
return $this->belongsTo(Item::class); return $this->belongsTo(Item::class);
} }
public function machine(): BelongsTo
{
return $this->belongsTo(Machine::class);
}
protected static function booted() protected static function booted()
{ {
static::created(function ($productionQuantity) { static::created(function ($productionQuantity) {

View File

@@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql = <<<'SQL'
ALTER TABLE production_plans
ADD COLUMN item_id BIGINT DEFAULT NULL,
ADD CONSTRAINT production_plans_item_id_fkey
FOREIGN KEY (item_id) REFERENCES items(id);
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('production_plans', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql = <<<'SQL'
ALTER TABLE lines
ADD COLUMN block_id BIGINT DEFAULT NULL,
ADD CONSTRAINT lines_block_id_fkey
FOREIGN KEY (block_id) REFERENCES blocks(id);
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('lines', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -1,40 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE items
ADD COLUMN line_id BIGINT DEFAULT NULL,
ADD CONSTRAINT items_line_id_fkey
FOREIGN KEY (line_id) REFERENCES lines(id);
SQL;
DB::statement($sql1);
$sql2 = <<<'SQL'
ALTER TABLE items
ADD COLUMN line_capacity TEXT DEFAULT NULL
SQL;
DB::statement($sql2);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('items', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql = <<<'SQL'
ALTER TABLE production_quantities
ADD COLUMN machine_id BIGINT DEFAULT NULL,
ADD CONSTRAINT production_quantities_machine_id_fkey
FOREIGN KEY (machine_id) REFERENCES machines(id);
SQL;
DB::statement($sql);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('production_quantities', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE production_plans
ADD COLUMN working_days TEXT DEFAULT NULL
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('production_plans', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$sql1 = <<<'SQL'
ALTER TABLE production_plans
ADD COLUMN leave_dates TEXT DEFAULT NULL
SQL;
DB::statement($sql1);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('production_plans', function (Blueprint $table) {
// //
// });
}
};

View File

@@ -65,6 +65,7 @@
}, },
body: JSON.stringify(subscription) body: JSON.stringify(subscription)
}); });
alert("Push notifications enabled ✅"); alert("Push notifications enabled ✅");
} }
</script> </script>

View File

@@ -1,13 +0,0 @@
<x-filament-panels::page>
<div class="space-y-4">
{{-- Render the Select form fields --}}
<div class="space-y-4">
{{ $this->form }}
</div>
</div>
</x-filament-panels::page>

View File

@@ -45,7 +45,7 @@
</div> --}} </div> --}}
<div class="flex gap-6 -mt-6"> <div class="flex gap-6 -mt-6">
<!-- Scan QR Code --> <!-- Scan QR Code -->
<div class="w-full"> <div class="w-1/2">
<label for="qr-scan-input" class="block text-sm font-medium text-gray-700 mb-2"> <label for="qr-scan-input" class="block text-sm font-medium text-gray-700 mb-2">
SCAN QR CODE SCAN QR CODE
</label> </label>
@@ -60,7 +60,7 @@
</div> </div>
<!-- Last Scanned QR --> <!-- Last Scanned QR -->
{{-- <div class="w-1/2"> <div class="w-1/2">
<label for="recent-qr-input" class="block text-sm font-medium text-gray-700 mb-2"> <label for="recent-qr-input" class="block text-sm font-medium text-gray-700 mb-2">
LAST SCANNED QR LAST SCANNED QR
</label> </label>
@@ -71,7 +71,7 @@
readonly readonly
wire:model="recent_qr" wire:model="recent_qr"
/> />
</div> --}} </div>
</div> </div>

View File

@@ -1,19 +0,0 @@
<x-filament-panels::page>
<div class="space-y-4">
{{-- Render the Select form fields --}}
<div class="space-y-4">
{{ $this->form }}
</div>
<x-filament::button
wire:click="export"
color="primary"
class="mt-4"
>
Export
</x-filament::button>
<div class="bg-white shadow rounded-xl p-4 mt-6">
<livewire:production-target-plan />
</div>
</div>
</x-filament-panels::page>

View File

@@ -1,151 +0,0 @@
<!-- <select id="yearSelect">
<option value="">Select Year</option>
</select> -->
<div id="calendar" wire:ignore></div>
<!-- <input type="text" name="working_days" placeholder="Working Days"> -->
<link href="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.8/index.global.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.8/index.global.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
let selectedDates = [];
let calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth',
height: 600,
showNonCurrentDates: true,
datesSet: function(info) {
// Clear previous month selections
selectedDates = [];
// Remove background events
calendar.removeAllEvents();
// Recalculate working days for new month
updateWorkingDays(info.view.currentStart);
},
dateClick: function(info) {
let viewMonth = calendar.view.currentStart.getMonth();
let clickedMonth = info.date.getMonth();
if (viewMonth != clickedMonth) return;
let dateStr = info.dateStr;
if (selectedDates.includes(dateStr)) {
selectedDates = selectedDates.filter(d => d !== dateStr);
calendar.getEvents().forEach(event => {
if (event.startStr == dateStr) event.remove();
});
} else {
selectedDates.push(dateStr);
calendar.addEvent({
start: dateStr,
display: 'background',
color: '#f03f17'
});
}
updateWorkingDays(info.date);
}
});
// var calendar = new FullCalendar.Calendar(calendarEl, {
// initialView: 'dayGridMonth',
// height: 600,
// showNonCurrentDates: true,
// dateClick: function(info) {
// let viewMonth = calendar.view.currentStart.getMonth();
// let clickedMonth = info.date.getMonth();
// // let month = info.date.getMonth() + 1; // JS month: 0-11 → 1-12
// // let year = info.date.getFullYear();
// if (viewMonth != clickedMonth) {
// return; // Ignore next/prev month dates
// }
// let dateStr = info.dateStr;
// if (selectedDates.includes(dateStr)) {
// selectedDates = selectedDates.filter(d => d !== dateStr);
// calendar.getEvents().forEach(event => {
// if (event.startStr == dateStr) {
// event.remove();
// }
// });
// } else {
// selectedDates.push(dateStr);
// calendar.addEvent({
// start: dateStr,
// display: 'background',
// color: '#f03f17'
// });
// }
// updateWorkingDays(info.date);
// }
// });
// yearSelect.addEventListener('change', function () {
// let year = this.value;
// if (!year) return;
// let currentDate = calendar.getDate();
// let newDate = new Date(year, currentDate.getMonth(), 1);
// calendar.gotoDate(newDate);
// });
function updateWorkingDays(date) {
let totalDays = new Date(
date.getFullYear(),
date.getMonth()+1,
0
).getDate();
let workingDays = totalDays - selectedDates.length;
// document.querySelector('input[name="working_days"]').value = workingDays;
const input = document.querySelector('#working_days');
input.value = workingDays;
input.dispatchEvent(new Event('input'));
const monthInput = document.querySelector('#month');
monthInput.value = date.getMonth() + 1; // 112 month number
monthInput.dispatchEvent(new Event('input'));
const yearInput = document.querySelector('#year');
yearInput.value = date.getFullYear();
yearInput.dispatchEvent(new Event('input'));
const selectedDatesInput = document.querySelector('#selected_dates');
selectedDatesInput.value = selectedDates.join(',');
selectedDatesInput.dispatchEvent(new Event('input'));
}
calendar.render();
});
</script>

View File

@@ -1,9 +0,0 @@
<div class="flex space-x-2 items-center">
<button
type="button"
class="inline-flex items-center px-3 py-1 bg-primary-600 text-white rounded hover:bg-primary-700"
wire:click="saveWorkingDays"
>
Save
</button>
</div>

View File

@@ -1,85 +0,0 @@
<div class="p-4">
<h2 class="text-lg font-bold mb-4 text-gray-700 uppercase tracking-wider">
PRODUCTION PLAN TABLE:
</h2>
<div class="overflow-x-auto rounded-lg shadow">
<table class="w-full divide-y divide-gray-200 text-sm text-center">
{{-- <thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
<tr>
<th class="border px-4 py-2">No</th>
<th class="border px-4 py-2">Created Datetime</th>
<th class="border px-4 py-2 whitespace-nowrap">Created By</th>
<th class="border px-4 py-2 whitespace-nowrap">Plant</th>
<th class="border px-4 py-2">Line</th>
<th class="border px-4 py-2 whitespace-nowrap">Item Code</th>
<th class="border px-4 py-2">Production Plan Dates</th>
</tr>
</thead> --}}
<thead class="bg-gray-100 text-s font-semibold uppercase text-gray-700">
<tr>
<th class="border px-4 py-2" rowspan="3">No</th>
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Plant</th>
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Line</th>
<th class="border px-4 py-2 whitespace-nowrap" rowspan="3">Item Code</th>
<th class="border px-4 py-2 whitespace-nowrap" colspan="{{ count($dates) * 2 }}" class="text-center">
Production Plan Dates
</th>
</tr>
<tr>
@foreach($dates as $date)
<th colspan="2" class="text-center">
{{ $date }}
</th>
@endforeach
</tr>
<tr>
@foreach($dates as $date)
<th class="border px-4 py-2 whitespace-nowrap">Target Plan</th>
<th class="border px-4 py-2 whitespace-nowrap">Produced Quantity</th>
@endforeach
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse ($records as $index => $record)
<tr class="hover:bg-gray-50">
<td class="border px-4 py-2">{{ $index + 1 }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['plant_name'] }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['line_name'] }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['item_code'] }}</td>
{{-- @foreach($dates as $date)
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['target_plan'][$date] ?? '-' }}</td>
<td class="border px-4 py-2 whitespace-nowrap">{{ $record['production_plan'][$date] ?? '-' }}</td>
@endforeach --}}
@foreach($dates as $date)
@if(in_array($date, $leaveDates))
<td class="border px-4 py-2 whitespace-nowrap">-</td>
<td class="border px-4 py-2 whitespace-nowrap">-</td>
@else
{{-- <td class="border px-4 py-2 whitespace-nowrap">{{ $record['daily_target'] ?? '-' }}</td> --}}
<td class="border px-4 py-2 whitespace-nowrap">
{{ $record['daily_target_dynamic'][$date] ?? '-' }}
</td>
<td class="border px-4 py-2 whitespace-nowrap">
{{ $record['produced_quantity'][$date] ?? '-' }}
</td>
{{-- <td class="border px-4 py-2 whitespace-nowrap">{{ $record['produced_quantity'] ?? '-' }}</td> --}}
@endif
@endforeach
</tr>
@empty
<tr>
<td colspan="9" class="px-4 py-4 text-center text-gray-500">
No production plan data found.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>

View File

@@ -25,15 +25,12 @@ use App\Http\Controllers\ObdController;
use App\Http\Controllers\PalletController; use App\Http\Controllers\PalletController;
use App\Http\Controllers\PdfController; use App\Http\Controllers\PdfController;
use App\Http\Controllers\PlantController; use App\Http\Controllers\PlantController;
use App\Http\Controllers\PrintController;
use App\Http\Controllers\ProductionStickerReprintController; use App\Http\Controllers\ProductionStickerReprintController;
use App\Http\Controllers\SapFileController; use App\Http\Controllers\SapFileController;
use App\Http\Controllers\StickerMasterController; use App\Http\Controllers\StickerMasterController;
// use App\Http\Controllers\TelegramController; // use App\Http\Controllers\TelegramController;
use App\Http\Controllers\TestingPanelController; use App\Http\Controllers\TestingPanelController;
use App\Http\Controllers\UserController; use App\Http\Controllers\UserController;
use App\Models\WebPushSubscription;
use Filament\Facades\Filament;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
@@ -188,46 +185,3 @@ Route::post('file/store', [SapFileController::class, 'store'])->name('file.store
// Route::post('send-telegram', [TelegramController::class, 'sendMessage']); // Route::post('send-telegram', [TelegramController::class, 'sendMessage']);
// Route::post('invoice-exit', [InvoiceValidationController::class, 'handle']); // Route::post('invoice-exit', [InvoiceValidationController::class, 'handle']);
Route::post('/print-pdf', [PrintController::class, 'print']);
Route::post('/push/subscribe', function (Request $request) {
$user = Filament::auth()->user();
abort_if(!$user, 401);
$request->validate([
'endpoint' => 'required|string',
'keys.p256dh' => 'required|string',
'keys.auth' => 'required|string',
]);
// WebPushSubscription::updateOrCreate(
// ['endpoint' => $request->endpoint],
// [
// 'subscribable_type' => get_class($user),
// 'subscribable_id' => $user->id,
// 'public_key' => $request->keys['p256dh'],
// 'auth_token' => $request->keys['auth'],
// 'content_encoding' => $request->contentEncoding ?? 'aesgcm',
// ]
// );
WebPushSubscription::updateOrCreate(
[
'endpoint' => $request->endpoint,
'subscribable_type' => get_class($user),
'subscribable_id' => $user->id,
],
[
'public_key' => $request->keys['p256dh'],
'auth_token' => $request->keys['auth'],
'content_encoding' => $request->contentEncoding ?? 'aesgcm',
]
);
return response()->json(['success' => true]);
});

View File

@@ -59,9 +59,10 @@ use App\Http\Livewire\CustomLogin;
]); ]);
WebPushSubscription::updateOrCreate( WebPushSubscription::updateOrCreate(
// ✅ UNIQUE PER DEVICE
['endpoint' => $request->endpoint], ['endpoint' => $request->endpoint],
[ [
'subscribable_type' => get_class($user), 'subscribable_type' => get_class($user), // 🔥 important
'subscribable_id' => $user->id, 'subscribable_id' => $user->id,
'public_key' => $request->keys['p256dh'], 'public_key' => $request->keys['p256dh'],
'auth_token' => $request->keys['auth'], 'auth_token' => $request->keys['auth'],
@@ -69,20 +70,6 @@ use App\Http\Livewire\CustomLogin;
] ]
); );
// WebPushSubscription::updateOrCreate(
// [
// 'endpoint' => $request->endpoint,
// 'subscribable_type' => get_class($user),
// 'subscribable_id' => $user->id,
// ],
// [
// 'public_key' => $request->keys['p256dh'],
// 'auth_token' => $request->keys['auth'],
// 'content_encoding' => $request->contentEncoding ?? 'aesgcm',
// ]
// );
return response()->json(['success' => true]); return response()->json(['success' => true]);
}); });