Fix SlugTrait

This commit is contained in:
Kelvin Zhang 2015-08-31 13:53:22 +01:00
parent 39290f8204
commit 32e19fb4e5
2 changed files with 11 additions and 9 deletions

View file

@ -2,6 +2,7 @@
namespace App;
use App\Traits\SlugTrait;
use Exception;
use External;
use getid3_writetags;
@ -15,7 +16,6 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Str;
use Traits\SlugTrait;
class Track extends Model
{

View file

@ -1,11 +1,13 @@
<?php
namespace Traits;
namespace App\Traits;
use Illuminate\Support\Str;
trait SlugTrait {
public function setTitleAttribute($value) {
trait SlugTrait
{
public function setTitleAttribute($value)
{
$this->slug = Str::slug($value);
$this->attributes['title'] = $value;
}