Problems with Accessors and Mutators in Laravel 5

0

Following an example of L5 in your documentation, what I present here should print a title in capital letters, it is just an example because what I want to do is something else but if the example does not work for me it is because something is wrong for me .

here my code

public function getTituloAttibute()
  {

       return strtoupper($this->title);
  }

That should return a Title like that TITLE by printing it in the {{$ article-> title}}

view

Returns the value as it is inserted in the DB

    
asked by vdjkelly 31.03.2016 в 03:48
source

1 answer

0

There is an error in the name of the method (missing an r in Attibute):

public function getTituloAttribute()
{
   return strtoupper($this->title);
}
    
answered by 31.03.2016 / 14:16
source