Skip to content

Instantly share code, notes, and snippets.

@oriolrivera
Created April 18, 2015 17:46
Show Gist options
  • Save oriolrivera/f236b87c90bdc9993c4a to your computer and use it in GitHub Desktop.
Save oriolrivera/f236b87c90bdc9993c4a to your computer and use it in GitHub Desktop.
SluggableInterface laravel 5 model articulos
<?php namespace blog;
use Illuminate\Database\Eloquent\Model;
//EloquentSluggable library
use Cviebrock\EloquentSluggable\SluggableInterface;
use Cviebrock\EloquentSluggable\SluggableTrait;
class Articulo extends Model implements SluggableInterface{
use SluggableTrait;
protected $table = 'articulos';
protected $filliable = ["titulo", "contenido", "slug", "imagen", tags]
protected $sluggable = array(
'build_from' => 'titulo',
'save_to' => 'slug',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment