md5 media file names

This commit is contained in:
HolgerHatGarKeineNode
2023-02-02 15:54:47 +01:00
parent 104ae8c0a6
commit 5d3919466f
8 changed files with 79 additions and 13 deletions

View File

@@ -66,7 +66,9 @@ class BitcoinEvent extends Resource
->sortable(),
Images::make(__('Logo'), 'logo')
->conversionOnIndexView('thumb'),
->showStatistics()
->conversionOnIndexView('thumb')
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Boolean::make(__('Show worldwide'), 'show_worldwide')
->help(__('If checked, the event will be shown everywhere.')),
@@ -85,21 +87,24 @@ class BitcoinEvent extends Resource
->rules('required', 'string'),
Markdown::make(__('Description'), 'description')
->rules('required', 'string')
->hideFromIndex(),
->rules('required', 'string')
->hideFromIndex(),
Text::make('Link')
->rules('required', 'string'),
BelongsTo::make(__('Venue'), 'venue', Venue::class)
->searchable()->showCreateRelationButton()->withSubtitles(),
->searchable()
->showCreateRelationButton()
->withSubtitles(),
BelongsTo::make(__('Created By'), 'createdBy', User::class)
->canSee(function ($request) {
return $request->user()
->hasRole('super-admin');
})
->searchable()->withSubtitles(),
->searchable()
->withSubtitles(),
];
}

View File

@@ -85,12 +85,16 @@ class Course extends Resource
->sortable(),
Images::make(__('Main picture'), 'logo')
->conversionOnIndexView('thumb'),
->showStatistics()
->conversionOnIndexView('thumb')
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
// todo: english
Images::make(__('Images'), 'images')
->showStatistics()
->conversionOnIndexView('thumb')
->help(__('Upload images here to insert them later in the Markdown Description. But you have to save before.')),
->help(__('Upload images here to insert them later in the Markdown Description. But you have to save before.'))
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Tags::make(__('Tags'))
->type('course')

View File

@@ -79,11 +79,15 @@ class Lecturer extends Resource
->sortable(),
Images::make('Avatar', 'avatar')
->conversionOnIndexView('thumb'),
->showStatistics()
->conversionOnIndexView('thumb')
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Images::make(__('Images'), 'images')
->showStatistics()
->conversionOnIndexView('thumb')
->help('Upload images here to insert them later in the Markdown Description. But you have to save before.'),
->help('Upload images here to insert them later in the Markdown Description. But you have to save before.')
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Text::make('Name')
->rules('required', 'string'),

View File

@@ -105,16 +105,20 @@ class LibraryItem extends Resource
Images::make(__('Main picture'), 'main')
->conversionOnIndexView('thumb')
->showStatistics(),
->showStatistics()
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Images::make(__('Images'), 'images')
->conversionOnIndexView('thumb')
->help('Upload images here to insert them later in the Markdown Description. But you have to save before.')
->hideFromIndex()
->showStatistics(),
->showStatistics()
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Files::make(__('Downloadable File'), 'single_file')
->help(__('Please contact the admins for new file types, otherwise pack the files in a ZIP! (Currently: PDF, ZIP)')),
->showStatistics()
->help(__('Please contact the admins for new file types, otherwise pack the files in a ZIP! (Currently: PDF, ZIP)'))
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Select::make(__('Language Code'), 'language_code')
->options(

View File

@@ -79,7 +79,8 @@ class Meetup extends Resource
Images::make(__('Logo'), 'logo')
->conversionOnIndexView('thumb')
->showStatistics(),
->showStatistics()
->setFileName(fn($originalFilename, $extension, $model) => md5($originalFilename).'.'.$extension),
Text::make('Name')
->rules('required', 'string')