Pony.fm/app/Traits/SlugTrait.php

14 lines
235 B
PHP
Raw Normal View History

2015-08-30 14:29:12 +02:00
<?php
namespace Poniverse\Ponyfm\Traits;
2015-08-30 14:29:12 +02:00
2015-08-31 14:53:22 +02:00
use Illuminate\Support\Str;
2015-08-30 14:29:12 +02:00
2015-08-31 14:53:22 +02:00
trait SlugTrait
{
public function setTitleAttribute($value)
{
$this->slug = Str::slug($value);
$this->attributes['title'] = $value;
}
}