Support the ongoing development of Laravel.io →
Eloquent Views Blade
Last updated 2 years ago.
0

Noone answered so I decided to use Traits, cause there is more than one contactable model.

trait ContactableTrait {
  public function getContactData($column) {
    return $this->contactData ? $this->contactData->$column : '';
  }
}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

kticka kticka Joined 7 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.