Başka yol yok değil bu işin mantıklı yolu trait kullanmak:
trait FormattedTimestamps {
public function getCreatedAtFormattedAttribute($value){
if($this->usesTimestamps() && !is_null(static::CREATED_AT)) {
return $this->created_at->isoFormat('D MMMM YYYY, dddd HH:mm');
}
}
public function getUpdatedAtFormattedAttribute($value){
if($this->usesTimestamps() && !is_null(static::UPDATED_AT)) {
return $this->updated_at->isoFormat('D MMMM YYYY, dddd HH:mm');
}
}
}
class User extends Authenticatable
{
use Notifiable, FormattedTimestamps;
}
<tr>
<td>{{ $user->created_at_formatted }}</td>
<td>{{ $user->updated_at_formatted }}</td>
</tr>
İlla tek seferde istiyorsanız bir tane abstract base model oluşturup Model sınıfını extend edersiniz ve accessorları ona eklersiniz. Sizin modelleriniz de bu base modeli extend eder. Bence gerek yok, modellerde tek tek kontrol elimde olsun isterim.