how sluggify a model with cviebrock slugs laravel -
i ran simple problem. installed this package , wish sluggify entire model.
i have upgraded m model definition instructed:
protected $sluggable = array( 'build_from' => 'fullname', 'save_to' => 'slug', ); public function getfullnameattribute() { return $this->firstnames . '-' . $this->surname; }
but lost...
how sluggify records in table?
ok, know. package's author wrote in readme.md, each record can reslugged on save.
so came op crude working solution:
in index method:
$object = author::get(); foreach($object $o) { $o->save(); }
Comments
Post a Comment