24-hours-phone-service 24 hours emergency
blog-image

41

 

I believe this isn't working because you aren't trying to set a slug attribute so that function never gets hit.

I'd suggest setting $this->attributes['slug'] = ... in your setTitleAttribute() function so it runs whenever you set a title.

Otherwise, another solution would be to create an event on save for your model which would set it there.

Edit: According to comments, it's also necessary to actually set the title attribute in this function as well...

Leave a Reply

24-hours-phone-serviceEmergency Medical Care 24/7

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Delectus alias consectetur minima incidunt fugiat voluptates culpa ratione, amet qui cupiditate ut maiores, iste a nostrum enim dolorum aperiam dignissimos adipisci.

+91-000-0000-000