Forum Laravel 2 Mutators in 1 model ??? is posible
Hi, i'm in this situation where i'm accessing same model mutator from 2 different end points, so i need to make different mutator for every endpoint.
// this is the current mutator that i already have it fetches the code DB column
public function getEmbedAttribute($value) { $info = Embed::create($value); return $info->code; }
the other mutator should fetches image instead of code,
public function getEmbedAttribute($value) { $info = Embed::create($value); return $info->image; }
Any ideas ????
Please sign in or create an account to participate in this conversation.
There's no shortage of content at Laracasts. In fact, you could watch nonstop for days upon days, and still not see everything!
Get Started
2 Mutators in 1 model ??? is posible
Hi, i'm in this situation where i'm accessing same model mutator from 2 different end points, so i need to make different mutator for every endpoint.
// this is the current mutator that i already have it fetches the code DB column
the other mutator should fetches image instead of code,
Any ideas ????