Add gallery to app

This commit is contained in:
2021-09-26 21:05:48 +02:00
parent 2f61e1342e
commit c2480ea73c
13 changed files with 152134 additions and 28 deletions

View File

@@ -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{