Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sarun Mungthanya
SpnPatch-Laravel
Commits
d47812f2
Commit
d47812f2
authored
Dec 03, 2024
by
Chanon.u
Browse files
Comment function for autocomplete message
parent
a4597286
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Livewire/Pages/ManualResponse/ManualResponse.php
View file @
d47812f2
...
...
@@ -324,24 +324,24 @@ class ManualResponse extends Component
$this
->
showSearch
=
false
;
}
public
function
updatedXmlData
(
$value
,
$key
)
{
if
(
$key
===
'Message'
)
{
$this
->
showSearch
=
true
;
$tempCode
=
MasterResponseTemplates
::
find
(
$this
->
templateId
);
$tempDoc
=
MasterMessages
::
find
(
$this
->
messageId
);
if
(
$tempCode
&&
$tempDoc
)
{
$message
=
MasterResponseMessageType
::
where
(
'doctype'
,
strtoupper
(
$tempDoc
->
name
))
->
where
(
'codestatus'
,
$tempCode
->
code
)
->
where
(
'message'
,
'like'
,
'%'
.
$value
.
'%'
)
->
get
();
}
else
{
$message
=
collect
();
// Return an empty collection if no data is found
}
$this
->
masterMsg
=
$message
;
}
//
public function updatedXmlData($value, $key)
//
{
//
if ($key === 'Message') {
//
$this->showSearch = true;
//
$tempCode = MasterResponseTemplates::find($this->templateId);
//
$tempDoc = MasterMessages::find($this->messageId);
//
if ($tempCode && $tempDoc) {
//
$message = MasterResponseMessageType::where('doctype', strtoupper($tempDoc->name))
//
->where('codestatus', $tempCode->code)
//
->where('message', 'like', '%' . $value . '%')
//
->get();
//
} else {
//
$message = collect(); // Return an empty collection if no data is found
//
}
//
$this->masterMsg = $message;
//
}
}
//
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment