This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
KurtJensen
Refer to : https://laravel.com/docs/5.1/eloquent-mutators#accessors-and-mutators
When I use an accessor in a settings model it only works in the settings controller, not in a component or backend controller.
Example:
// In Settings model
public function getShiftStartTimeAttribute($value)
{
return substr($value, 0, 5);
}
// This works in Settings controller to trim value for timepicker down to HH:MM
But in another controller or component, when I do:
$begining_at = Settings::get('shift_start_time');
// This DOES NOT work to trim value for timepicker down to HH:MM ( I get HH:MM:SS)
1-2 of 2