Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
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
Siti Aisah
webprofile-jwg2024
Commits
081a8ca9
Commit
081a8ca9
authored
Dec 19, 2019
by
Aan Choesni Herlingga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix store local and delete file local
parent
8ebc4736
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
app/Repositories/Webprofile/SliderRepository.php
+28
-2
No files found.
app/Repositories/Webprofile/SliderRepository.php
View file @
081a8ca9
...
...
@@ -52,7 +52,7 @@ class SliderRepository extends Repository
if
(
$setting
[
'external_storage'
]
==
1
)
{
Storage
::
disk
(
'storage'
)
->
put
(
$setting
[
'directory'
]
.
'/slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
else
{
Storage
::
disk
(
'local'
)
->
put
(
'slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
Storage
::
disk
(
'local'
)
->
put
(
'
public/
slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
$data
[
'images'
]
=
$filename
;
}
...
...
@@ -81,7 +81,7 @@ class SliderRepository extends Repository
if
(
$setting
[
'external_storage'
]
==
1
)
{
Storage
::
disk
(
'storage'
)
->
put
(
$setting
[
'directory'
]
.
'/slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
else
{
Storage
::
disk
(
'local'
)
->
put
(
'slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
Storage
::
disk
(
'local'
)
->
put
(
'
public/
slider/'
.
$filename
,
file_get_contents
(
$cover
->
getRealPath
()));
}
$data
[
'images'
]
=
$filename
;
...
...
@@ -91,6 +91,32 @@ class SliderRepository extends Repository
return
$sModel
->
update
(
$data
);
}
/**
* Remove the specified resource from storage.
*
* @param \App\Models\Slider $slider
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
$sModel
)
{
$setting
=
webprofilesetting
();
try
{
if
(
$sModel
->
images
)
{
if
(
$setting
[
'external_storage'
]
==
1
)
{
Storage
::
disk
(
'storage'
)
->
delete
(
$setting
[
'directory'
]
.
'/slider/'
.
$sModel
->
images
);
}
else
{
Storage
::
disk
(
'local'
)
->
delete
(
'public/slider/'
.
$sModel
->
images
);
}
}
$sModel
->
delete
(
$sModel
->
id
);
return
redirect
()
->
route
(
'sliders.index'
);
}
catch
(
\Exception
$id
)
{
return
redirect
()
->
route
(
'sliders.index'
);
}
}
public
function
datatable
(
$data
)
{
$setting
=
webprofilesetting
();
...
...
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