In order to upload the image in the crops for the image need to be added to the settings array in the twill config file.
'settings' => [
'crops' => [
'[NAME]' => [
'[CROP]' => [
[
'name' => 'foobar',
'ratio' => 1,
],
],
],
],
],
To retrive the image you cannot use the standard app(SettingRepository::class)->byKey('key','section')
method. This is because this method will automatically (and only) return values from the setting_translations DB table. Instead you must access the setting directly:
use A17\Twill\Models\Setting;
$setting = Setting::firstWhere('key', 'setting_name');
$img = $setting->imageObject('role_name');
I can't get images working in settings. So just to clarify, a crop definition is required in the main twill config file and also within the properties of the view where the media field is defined ?