Created
April 18, 2015 17:46
-
-
Save oriolrivera/f236b87c90bdc9993c4a to your computer and use it in GitHub Desktop.
SluggableInterface laravel 5 model articulos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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