Add gallery to app
This commit is contained in:
@@ -41,15 +41,15 @@ class Upload extends Controller
|
||||
$location = config('app.image.dir');
|
||||
|
||||
$backupdir = Carbon::now()->format('Y/m/d');
|
||||
$backupdir = sprintf($location.'/backup/%s',$backupdir);
|
||||
$thumbdir = sprintf('%s/%s', config('app.image.thumb_dir'), Carbon::now()->format('Y/m/d'));
|
||||
$backupdir = sprintf($location.'/backup/%s',$backupdir);
|
||||
$thumbdir = sprintf('%s/%s', config('app.image.thumb_dir'), Carbon::now()->format('Y/m/d'));
|
||||
$bckfile = Carbon::now()->format('Hi');
|
||||
$bckfile = sprintf('%s.jpg',$bckfile);
|
||||
// Upload file
|
||||
$file->move($backupdir,$bckfile);
|
||||
\File::copy($backupdir."/".$bckfile,$location."/".$filename);
|
||||
$image = Image::make($backupdir."/".$bckfile)->resize(160, 120);
|
||||
\File::makeDirectory($thumbdir, $mode = 0770, true, true);
|
||||
$image = Image::make($backupdir."/".$bckfile)->resize(160, 120);
|
||||
\File::makeDirectory($thumbdir, $mode = 0770, true, true);
|
||||
$image->save( $thumbdir.'/'.$bckfile);
|
||||
echo 'Upload Successful.';
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user