fix: updated, added filament, misc hotfixes.
This commit is contained in:
@@ -126,9 +126,20 @@ class ArtworkController extends Controller
|
||||
$episode = $podcast->episodes->first();
|
||||
$artist = auth()->user()->artists()->first();
|
||||
$rawFile = $request->file('file');
|
||||
$filename = now()->format('Y')
|
||||
$yearDirectory = now()->format('Y');
|
||||
$monthDirectory = now()->format('m');
|
||||
$indexPath = $yearDirectory . '/' . $monthDirectory . '/index.htm';
|
||||
$imgDirExists = Storage::disk('static')->exists('artworks/' . $indexPath);
|
||||
$thumbDirExists = Storage::disk('static')->exists('thumbnails/' . $indexPath);
|
||||
if (!$imgDirExists) {
|
||||
Storage::disk('static')->put('artworks/' . $indexPath, '');
|
||||
}
|
||||
if (!$thumbDirExists) {
|
||||
Storage::disk('static')->put('thumbnails/' . $indexPath, '');
|
||||
}
|
||||
$filename = $yearDirectory
|
||||
. '/'
|
||||
. now()->format('m')
|
||||
. $monthDirectory
|
||||
. '/'
|
||||
. Str::slug($artist->name)
|
||||
. '-'
|
||||
@@ -143,17 +154,16 @@ class ArtworkController extends Controller
|
||||
'overlay_id' => null,
|
||||
'podcast_id' => $podcast->id,
|
||||
'episode_id' => $episode->id,
|
||||
//'approved_by' => 4,
|
||||
'filename' => $filename,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
])->create();
|
||||
$img = Image::make($rawFile)->resize(3000, null, function($constraint){
|
||||
$img = Image::make($rawFile)->resize(3000, null, function($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
})
|
||||
->encode('jpg', 100)
|
||||
->save(Storage::disk('static')->path('/artworks') . '/' . $artwork->filename);
|
||||
$thumbImg = Image::make($request->file('file'))->resize(512, null, function($constraint){
|
||||
$thumbImg = Image::make($request->file('file'))->resize(512, null, function($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
})
|
||||
->encode('jpg', 100)
|
||||
|
||||
Reference in New Issue
Block a user