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

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -