Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
excel-top-up-filter
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aung Khant Kyaw
excel-top-up-filter
Commits
817983ea
Commit
817983ea
authored
Nov 24, 2021
by
Aung Khant Kyaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove special character in phone numbers
parent
b6500fa0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
app/Helpers/Phone.php
+9
-0
app/Imports/DataImport.php
+1
-1
No files found.
app/Helpers/Phone.php
View file @
817983ea
...
@@ -45,4 +45,13 @@ class Phone
...
@@ -45,4 +45,13 @@ class Phone
return
$getAmount
;
return
$getAmount
;
}
}
public
static
function
cleanPhoneNo
(
$phnumber
)
{
$clearphone
=
str_replace
(
array
(
" "
,
"#"
,
"'"
,
";"
,
"-"
,
"
\"
"
),
""
,
$phnumber
);
$phonenumber
=
$clearphone
;
return
$phonenumber
;
}
}
}
app/Imports/DataImport.php
View file @
817983ea
...
@@ -34,7 +34,7 @@ class DataImport implements ToModel, WithBatchInserts, WithChunkReading
...
@@ -34,7 +34,7 @@ class DataImport implements ToModel, WithBatchInserts, WithChunkReading
// }
// }
return
new
Data
([
return
new
Data
([
'phone'
=>
$row
[
0
]
,
'phone'
=>
Phone
::
cleanPhoneNo
(
$row
[
0
])
,
'service'
=>
$this
->
sname
,
'service'
=>
$this
->
sname
,
'operator'
=>
Phone
::
getOperator
(
$row
[
0
]),
'operator'
=>
Phone
::
getOperator
(
$row
[
0
]),
'amount'
=>
((
count
(
$row
)
>
1
)
?
Phone
::
getAmount
(
$row
[
1
])
:
0
),
'amount'
=>
((
count
(
$row
)
>
1
)
?
Phone
::
getAmount
(
$row
[
1
])
:
0
),
...
...
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