Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
CO-OP Search
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kittisak Maneewong
CO-OP Search
Commits
99d3f00d
Commit
99d3f00d
authored
Apr 20, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add company
parent
e50609f8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
6 deletions
+38
-6
CompanyController.php
app/Http/Controllers/CompanyController.php
+36
-6
app.js
public/js/app.js
+0
-0
store.js
resources/js/store.js
+2
-0
EditCompany.vue
resources/js/views/EditCompany.vue
+0
-0
Company1555754135.jpeg
storage/uploads/Company1555754135.jpeg
+0
-0
No files found.
app/Http/Controllers/CompanyController.php
View file @
99d3f00d
...
...
@@ -35,14 +35,44 @@ class CompanyController extends Controller
*/
public
function
store
(
Request
$request
)
{
$image
=
$request
->
get
(
'image'
);
$name
=
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'image'
))
->
save
(
storage_path
(
'uploads/'
)
.
$name
);
$imageCompany
=
null
;
$imageMap
=
null
;
if
(
$request
->
get
(
'imageCompany'
)
!==
'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png'
)
{
$image
=
$request
->
get
(
'imageCompany'
);
$name
=
'Company'
.
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'imageCompany'
))
->
save
(
storage_path
(
'uploads/'
)
.
$name
);
$imageCompany
=
$name
;
}
if
(
$request
->
get
(
'imageMap'
))
{
$image
=
$request
->
get
(
'imageMap'
);
$name
=
'Map'
.
time
()
.
'.'
.
explode
(
'/'
,
explode
(
':'
,
substr
(
$image
,
0
,
strpos
(
$image
,
';'
)))[
1
])[
1
];
\Image
::
make
(
$request
->
get
(
'imageMap'
))
->
save
(
storage_path
(
'uploads/'
)
.
$name
);
$imageMap
=
$name
;
}
$company
=
new
Company
();
$company
->
imageCompany
=
'Company'
.
$name
;
$company
->
imageCompany
=
$imageCompany
;
$company
->
company_name
=
$request
->
get
(
'company_name'
);
$company
->
company_owner
=
$request
->
get
(
'company_owner'
);
$company
->
phone_no
=
$request
->
get
(
'phone_no'
);
$company
->
email
=
$request
->
get
(
'email'
);
$company
->
fax
=
$request
->
get
(
'fax'
);
$company
->
website
=
$request
->
get
(
'website'
);
$company
->
addr
=
$request
->
get
(
'addr'
);
$company
->
tambon
=
$request
->
get
(
'tumbon'
);
$company
->
amphoe
=
$request
->
get
(
'amphoe'
);
$company
->
province
=
$request
->
get
(
'province'
);
$company
->
zipcode
=
$request
->
get
(
'zip_code'
);
$company
->
imageMap
=
$imageMap
;
$company
->
lat
=
$request
->
get
(
'lat'
);
$company
->
long
=
$request
->
get
(
'lng'
);
$company
->
about
=
$request
->
get
(
'about'
);
$company
->
bts
=
$request
->
get
(
'bts'
);
$company
->
mrt
=
$request
->
get
(
'mrt'
);
$company
->
arl
=
$request
->
get
(
'arl'
);
$company
->
bus
=
$request
->
get
(
'bus'
);
$company
->
another
=
$request
->
get
(
'another'
);
$company
->
user_id
=
$request
->
get
(
'user_id'
);
$company
->
save
();
return
response
()
->
json
([
'success'
=>
'You have successfully uploaded an image'
],
200
);
}
/**
...
...
public/js/app.js
View file @
99d3f00d
This diff is collapsed.
Click to expand it.
resources/js/store.js
View file @
99d3f00d
...
...
@@ -12,6 +12,7 @@ export default new Vuex.Store({
email
:
null
},
employer
:
{
id
:
null
,
username
:
null
,
company_name
:
null
,
email
:
null
...
...
@@ -203,6 +204,7 @@ export default new Vuex.Store({
})
.
then
(
res
=>
{
commit
(
'setEmployer'
,
{
id
:
res
.
data
.
user
.
id
,
username
:
res
.
data
.
user
.
username
,
company_name
:
res
.
data
.
user
.
company_name
,
email
:
res
.
data
.
user
.
email_employers
...
...
resources/js/views/EditCompany.vue
View file @
99d3f00d
This diff is collapsed.
Click to expand it.
storage/uploads/Company1555754135.jpeg
0 → 100644
View file @
99d3f00d
211 KB
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